How can I configure Virtual Host without restarting Apache web server? - apache

I created a new virtual host in apache web server and I dont want to restart Apache
Does Anybody know How can I configure VirtualHost without restarting Apache web server?
Also Is it possible to do it on windows server?

this is not possible .... you have to restart the server to get new / changed vhost.
what you can do is: restart the server without kill any active connections by:
/etc/init.d/apache2 -graceful [*]
[*] /etc/init.d/apache2 is your executable file

You can reload apache2 for get affect newly changes.
$ sudo systemctl reload apache2

Related

Apache not starting alongside Nginx

Have a development server with 2 static ips. Apache runs on one, Nginx on the other. Everything seems fine except after reboot. Nginx starts Apache doesn't. Can someone please tell me where to look outside log files for what the issue could be...or tell me the process on how to make this work..
Thanks in advance...
12/19/2018
Rebuilt the server using only Apache. When binding it to a single ip to one interface it still does not start after boot. When I unbind it, it boots fine. Doesn't seem to be a conflict with Nginx on the other ip, seems to do with the binding of Apache itself...still perplexed...
I went to sudo nano /etc/apache2/ports.conf
Changed Listen 80 to Listen 8080 and I was able to restart apache2 after that with the following command:
sudo systemctl restart apache2
It's probably because default port for both nginx and apache is 80. So for example when nginx starts, the port will be in use, and apache can't access to that port.
in ypur httpd.conf of apache, find the line that says Listen 80 and change that port to whatever you want. then restart apache.
If this is not the issue, then report results of these commands in your post plz:
$ systemctl status httpd // or apache2 instead of httpd
$ systemctl status nginx
$ jourcanctl -xe

Gitlab-ee external url is not working

I installed gitlab-ee on my ubuntu 16.04 server hosted with AWS. I am not able to launch gitlab using the external url that is mentioned in gitlab.rb file. I have apache as default webserver. I used a subdomain as external url. But when i launch that url, it is still landing on default apache page and not using nginx to launch gitlab. How to solve this issue?
Apache and Nginx will probably try to use the same ports (80 & 443). The first started, in your case Apache, will start normally, but the second will not initialize properly as two programs can not listen together on the same ports.
Confirm with the command sudo gitlab-ctl status nginx. This will return the status of the integrated nginx instance.
If it is stopped, stop apache and then start nginx using sudo gitlab-ctl start nginx.

How to stop tomcat and start apache2?

I have this server, that i have not installed personally. There are Apache2 and Tomcat6 running together. I want to stop Tomcat6 and use Apache2 but when i do
sudo service tomcat6 stop
sudo service apache2 restart
if i type 'localhost' in my browser i get a '503 service unavailable' error. So how i can get Apache2 'take control'? I mean i want the default site of Apache2 to be displayed on 'localhost' instead of tomcat'one.
(If i type locahost with Tomcat running i get an "it works" welcome page.)
Apache2 will have control when Tomcat is stopped and you start Apache. With Tomcat running on same port, you are unable to start Apache. Solution to 503 error is in Apache logs.

Starting web server apache2 failed

I have a Virtual Server. Till yesterday everything works fine on it.
Today my Hostcompany restarted my server to config something on I/O.
When I trying to get to my address I get
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
I tried to sudo service apache2 start and get these Error Message:
* Starting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
*
* The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
Does someone know how I can fix this problem?
Stop Nginx service nginx stop
Restart Apache service apache2 restart
You have another webserver that's running on the host (probably as part of the startup during the restart) You need to shut that off first.
You can run netstat -tulpn | grep :80 and that'll tell you what that process is
The problem is this, Nginx (another web server engine) it's using your port 80 so apache it's unable to start, a fast fix it turn of nginx and then restart apache.
You can do it with service nginx stop and service apache2 restart if you are using Ubuntu or Debian based release, if you are using an RHEL distro then use service nginx stop and service httpd restart
Here is my solution
first: sudo update-rc.d -f nginx remove
than: sudo rm /etc/init.d/nginx
after restarting VM almost everything works fine. Some strange thing is almost there.
When I goto www.myfoobarwebpage.com now apache is working and it's all ok!
When I goto myfoobarwebpage.com (without www.) I get "Welcome to nginx! ..."
Try this. My Apache config has 2 extra lines by mistake.
"Include conf/extra/httpd-8080.conf"
"Include conf/extra/httpd-8080.conf"
Therefore, it was saying address already in use because it already loaded the Virtual host once and was trying again.
Solution was to delete this extra line and have only one include.

httpd running internally but not externally

I have a new server running CentOS, and it has httpd running on 192.168.1.100:80.
I can connect to my server through ssh on 192.168.1.100, but when I go to 192.168.1.100 in my browser, it says "Oops! Google Chrome could not connect to 192.168.1.100".
I also tried wget to see if that works, and here is where it gets interesting.
when I run:
wget 192.168.1.100
On my server it gets the index.html file as it should.
but when I run it on my laptop is says "Connecting to 192.168.1.100:80... failed: No route to host."
Does anyone know how to fix this?
Seems like your Apache configuration binds httpd to 192.168.1.100:80
Find line Listen 192.168.1.100:80 in Apache main configuration - something like /etc/httpd/httpd.conf or /etc/apache2/httpd.conf and change this line to Listen 0.0.0.0:80.
Restart Apache and it will probably work.