GitLab: How to use ONLY Apache2 and skip nginx? - apache

I am running GitLab on Port 81 today and I need it to run on Port 80 or 443 so that I can access it from office. Problem is that I already host other services using Apache2 on both those ports.
I have tried for hours and hours to do a proxy forward of GitLab from Apache2 host:80/gitlab to host:81 (where nginx is hosting gitlab) without success. I just keep getting problems thanks to the added folder /gitlab in the URL.
So I am in the idea of selfhosting gitlab under my Apache2 server instead. I am thinking of this approach:
Create symlink to webroot of gitlab from /home/www/sites/gitlab
Set up a vhost in Apache on port 81 to point to above symlink.
Enable Apache2 to listen on port 81.
Verify that GitLab functions properly on port 81 using Apache2.
Once confirmed, set up a proxy forward from my Apache2 Port 80 under subdir /gitlab to forward to the new Apache2 Port 81 now hosting GitLab.
What I need to know now is:
Is it possible to completely host gitlab on your own Apache2?
What is necessary to enable in Apache2 virtual host dir? Or other configs? Ruby etc?
Where is the webroot of github index documents etc?
What do you think of permission issues? Will I see any problems?
Thank you all in advance!

Related

Varnish and additional ports

How can I add another port to Apache, and keep Varnish listening on port 80 only? The other new port would have a different document root.
Using Apache's sites-available configuration files you can specify what port the configured name should resolve on.

How to enable Apache SSL Reverse Proxy on HTTP application

I've been having problems attempting to implement a reverse SSL proxy on Apache for an HTTP application on Ubuntu 14.04. As a baseline, the application works fine when I access it via port 8000 in the browser normally. For all intents and purposes, let's say the IP of my app is 192.141.56.11 (I do not have a domain name yet). The application runs with HTTP Basic Auth, I don't know if it's relevant. Basically I'm fishing for some glaring error here and would be grateful if you could help me out. Here is a log of my process:
I created my SSL cert and key and put them in the following locations:
/etc/apache/ssl/apache.crt (I performed chmod 644 here)
/etc/apache/ssl/apache.key (I performed chmod 400 here)
I then installed:
apt-get install apache2
a2enmod proxy
a2enmod ssl
a2enmod proxy_http
I then disabled the default config with:
a2dissite 000-default
I created the file "/etc/apache2/sites-available/redirect.conf"
I then created the file "/etc/apache2/sites-available/redirect.conf" and copied the text below:
<VirtualHost *:80>
Redirect "/" "https://192.141.56.11"
</VirtualHost>
After, I created the file "/etc/apache2/sites-available/reverse_proxy.conf" and copied below:
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache/ssl/apache.crt
SSLCertificateKeyFile /etc/apache/ssl/apache.key
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
and did:
service apache2 restart
I now attempt to access the UI of the application on another machine in the Chrome browser. When trying:
https://192.141.56.11
I get a general SSL connection error.
However, trying
http://192.141.56.11:8000
gives me the application, as if none of my config changed anything. However,
192.141.56.11:80
gives me an "Index Of" page with an html folder that says "Apache/2.4.7 (Ubuntu) Server at 192.141.56.11 Port 80"
192.141.56.11:443
gives me the same result except with "Apache/2.4.7 (Ubuntu) Server at 192.141.56.11 Port 443"
I've tried all manners of configurations but can't get what I want -- any ideas here?
EDIT: I tried https[:]//192.141.56.11 and got a more specific SSL error:
received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)
EDIT2: After running apache, I get this warning;
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
I suppose this is fine as I am using an IP and not a domain name.
EDIT3: It turns out I needed to do:
a2ensite reverse_proxy.conf.
Now https[:]//192.141.56.11 works but defaults to an apache page. working on this.
EDIT4: I had to do
a2dissite default-ssl.conf
Now It actually redirects to the app on https[:]//192.141.56.11!! But I can still access the app via port 8000, which is bad {still working on}
EDIT5: IN the end, I couldn't figure out how to block access to the original app via port 8000 on Apache. Instead, I just implemented iptables on the server so that it can only be accessed via HTTPS. This is probably not the correct method. but all I could think of.

Problems with Apache Tomcat and Wamp

this is probably a noob problem but I can't get this to work. The Apache on wamp is currently on Listen 8080 because the regular localhost wouldn't work. However when I turn on Tomcat it is also on 8080 which is conflicting with wamp. I am connecting to Tomcat via Eclipse plugin. With Tomcat on I can't get into phpmyadmin on wamp.
Apache's httpd.conf in wamp is set to:
Listen 8080
ServerName localhost:80
Only with this setting I can get wamp to work.
localhost:8080 will work and 127.0.0.1:8080 works as well. Turning on Tomcat will automatically override wamp's settings. How can I get wamp to just be a regular localhost address and not have it take an 8080 port where Tomcat is sitting on?
try to change the port tomcat is using.
Go to conf folder in tomcat installation directory
e.g. C:\Tomcat 6.0\conf\
Edit following tag in server.xml file
Change the port=8080 value to port=80
Save file.
or another solution is , you can change your wamp port from 8080 to any other one...

how to create multiple ports for apache on amazon EC2?

I have Ubuntu 32 bit AMI(amazon machine image) on amazon cloud.
I have installed the LAMP stack on it.
apache: 2.4.7
mysql: 5.5.38
php: 5.5.9
Above are specification for A-M-P
Then I got the one public IP address.(x.x.x.x)
Now I need to create the multiple ports.
LIKE
x.x.x.x:81
x.x.x.x:82
is it possible??
I have done some steps for the ports configuration as follows:
vim /etc/apache2/ports.conf ==> add line Listen 81
in virtual host file
<VirtualHost *:81>
-------
</VirtualHost>
vim /etc/apache2/hosts ==> added line 127.0.0.1 vhost_name
sudo a2ensite vhost_file_name.conf
sudo /etc/init.d/apache2 restart
Follow these instructions:
EC2 Instance
Update Apache
File: /etc/apache2/ports.conf
Listen 80
Listen 81
Listen xx where xx is a valid port number
Add/Update Virtual Host
Create a virtual host that listens to 81 or the port number that Apache is listening to.
Enable the site with sudo a2ensite name of the conf without .conf
Restart the apache sudo service apache2 restart
Amazon Console
Find the security group of the instance on the instances list.
Go to Security Group (find it on the LHS meun) and add the rules to allow the external world to talk to the port numbers your apache is listening to. Please follow this link to add the rules.

How do I configure apache2 to a port other than port 80?

I have installed apache2 on ubunto and have messed around with the text on the localhost page. Now I'm being asked to show it running on a port other than port 80. How do I do that?
You should change the line Listen x in your httpd.conf where x is the port number. You'll need to restart your apache server after that.
In the file: /etc/apache2/httpd.conf
change the following line:
Listen 80
to:
Listen <NEWPORT>
After that you need to restart the apache server:
sudo service apache2 start
UPDATE: Looks like with Ubuntu, the default /etc/apache2/httpd.conf is empty and the recommended approach is to create a new .conf file under /etc/apache2/conf.d so that even with software updates, the user changes are persistent.
So just create a new file say /etc/apache2/conf.d/mycustomizations.conf
Listen <NEWPORT>