| Linux - Server This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-16-2012, 03:14 AM
|
#1
|
|
LQ Newbie
Registered: May 2006
Posts: 13
Rep:
|
Apache2 - disable default virtual hosts problem
Hi,
I have created 3 virtual hosts e.g. /etc/apache2/sites-available/mynewsite and used a2ensite and restarted apache. I can browse to the site no problem.
I want to disable the default site /etc/apache2/sites-available/default but when I issue a2dissite default and restart apache none of the virtual hosts can be accessed either?
How do I do this?
cheers
Mark
|
|
|
|
08-16-2012, 06:04 AM
|
#2
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,365
|
Hi,
I guess there is a
in /etc/apache2/sites-available/default, that there not exists in your vhosts files, that's why vhosts are not working
If you're sure you want to disable the default vhos, move the above directive into apache2.conf
Regards
|
|
|
|
08-16-2012, 08:29 AM
|
#3
|
|
LQ Newbie
Registered: May 2006
Posts: 13
Original Poster
Rep:
|
Quote:
Originally Posted by bathory
Hi,
I guess there is a
in /etc/apache2/sites-available/default, that there not exists in your vhosts files, that's why vhosts are not working
If you're sure you want to disable the default vhos, move the above directive into apache2.conf
Regards
|
This is my "/etc/apache2/sites-available/default" file contents
Code:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
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
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
No sign of a ?
|
|
|
|
08-16-2012, 10:06 AM
|
#4
|
|
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,365
|
Since you're using a <VirtualHost *:80> notation, there should be a directive like:
Code:
NameVirtualHost *:80
By default it's in the default vhost file. Maybe you have moved it in some other config file. So search /etc/apache2/
Anyway, what it the error you get whne trying to access your other vhosts?
|
|
|
|
08-17-2012, 06:28 AM
|
#5
|
|
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,780
|
I don't think you need to add 'namevirtualhost'; it's more than likely already set in one of the config files.
You can navigate to /etc/apache2 and run
Code:
grep -iR namevirtualhost *
to find it. You might find it in http.conf (not sure).
|
|
|
|
08-17-2012, 09:27 AM
|
#6
|
|
LQ Newbie
Registered: May 2006
Posts: 13
Original Poster
Rep:
|
The output of
Code:
grep -iR namevirtualhost *
is
Code:
ports.conf:NameVirtualHost *:80
ports.conf: # If you add NameVirtualHost *:443 here, you will also have to change
I might just leave it for now and come back later as someone has suggested it would be good practice to leave the default as a catchall?
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:32 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|