Apache not working after attempted Virtual Host configuration
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Apache not working after attempted Virtual Host configuration
The thread title says most of it. I'm trying to get Apache to serve two sites. I had the first one working after first installing Apache. Now I've tried adding a second site to the virtual host, but without any luck.
Here's my sites-available/default configuration file.
Code:
Listen 80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sheeponmeth.no-ip.biz
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName pursue.no-ip.biz
DocumentRoot /var/www_pte
ServerAdmin webmaster@localhost
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Apache won't even open port 80 at this point. I'm fairly new to configuring Apache, I don't have much experience with it apart from running vanilla/default configurations.
Thanks.
Last edited by devinmcelheran; 03-06-2014 at 02:25 PM.
This looks like a Debian-ish distro, yes?
I believe that the idea in the Debian configuration of Apache is that you place one file per virt host in /etc/sites-available
So if you break each server into one file each:
/etc/apache/sites-available/sheepsonmeth
/etc/apache/sites-available/pursue
and then place symlinks from
/etc/apache/sites-enabled/sheepsonmeth -> /etc/apache/sites-available/sheepsonmeth
/etc/apache/sites-enabled/pursue -> /etc/apache/sites-available/pursue
That would be the "correct" way of implementing this scheme on a Debian server.
I'm not sure if that's the root of your problem or not, but that's worth a shot to start with. Obviously after all changes you would want to restart the apache2 service.
I actually got it working. I think I did it sloppily, so I won't post my configuration. I guess there's a difference between the Virtual Servers and Virtual Hosts with Apache. From what I understand, each file is a Virtual Server, and each entry (like in mine) is a Virtual Host. So, technically, mine isn't done wrong, but it could be done better, like I said, it's a bit sloppy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.