I have a bunch of apache virtual hosts set up on an Ubuntu machine. They were working for a long time and now they're not:
$ a2ensite /etc/apache2/sites-available/somesite.com
ERROR: No site found matching /etc/apache2/sites-available/somesite.com!
What could I have done wrong? This is happening for all virtual hosts on my machine. They are all there under /etc/apache2/sites-available/ but apache doesn't seem to see them.
You should use a2ensite somesite.com.
Related
I create a virtual host using virtualhost.sh script (you can find it easily on GitHub), and mapped it to the root of my project folder (Yii2 Project), when I visit my virtual host, I got Apache 500 Internal Error.
Ubuntu LAMP
Thanks
The problem was in the rewrite module wasn't enabled by default when you install LAMP manually, and the .htaccess file in the root directory uses RewriteEngine...
Enable rewrite module:
sudo a2enmod rewrite
Then, you need to restart your Apache:
sudo service apache2 restart
Done.
I'm able to get the website with ssl enabled for a single site.
If I add virtual hosts under ssl.conf, the httpd refuses to start and I did setenforce 0, still no luck.
More details:
I created different certificate for the new virtual host. But seems like issue persists.
I m trying to create virtual host in my ubuntu 18.04 for my laravel project and i had installed xampp as well but there is no any apache2 folder created in my /etc folder so that i cant find sites-available/ folder
How to create virtual host in that case?
You can check this link and follow the given simple steps :
How To Configure Apache Virtual Hosts In Ubuntu 18.04 LTS
If ant any point you find any difficulty please let me know, I will try my level best to provide solution.
First of all, you'll have to install a Lamp Stack. You can follow this guide for it.
Then you can use this other guide to set up an Apache Virtual Host.
Note: You don't need Xampp at all.
I have the following host file entries on Ubuntu 14 machine running apache
127.0.0.1 localhost
10.20.32.20 library.myDNSname.org
10.20.32.20 library-intra.myDNSname.org
10.20.32.20 mtf
And also
sudo a2ensite library
sudo a2ensite mtf
sudo service apache2 restart
Now when I browse the site.. I can only access library.myDNSname.org page.
But When I
a2dissite library
I can access the mtf site.
Please note both site has been added to the sites-available.
Any Idea how I might run both site on the same server?
Thanks for input
I think it would have been more helpful if you had included your apache sites configuration and also how you are accessing your site (whether by ip or hostname).
If you are accessing your site by an ip then it will just select the default vhost which is the first vhost definition in the configuration file. For more info you can check out Apache's doc.
Please try to access the sites with hostnames and post errors in comments when you tried to access mtf site for the first time.
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