LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-06-2014, 02:00 PM   #1
devinmcelheran
Member
 
Registered: Jan 2009
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 145

Rep: Reputation: 16
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.
 
Old 03-06-2014, 02:32 PM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732Reputation: 732
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.
 
Old 03-06-2014, 02:33 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
What output does this command show?
Code:
# apachectl -t
 
Old 03-06-2014, 04:50 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://sheeponmeth.no-ip.biz works from here.

http://108.170.170.16:8080/ shows "it works!"

Last edited by Habitual; 03-06-2014 at 04:52 PM.
 
Old 03-06-2014, 05:07 PM   #5
devinmcelheran
Member
 
Registered: Jan 2009
Location: Ontario, Canada
Distribution: Arch Linux
Posts: 145

Original Poster
Rep: Reputation: 16
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.

Thanks for all the replies, though.
 
Old 03-07-2014, 08:41 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I put mine in /etc/httpd/conf.d/dorkblog.conf
each site could have it's own .conf file in the same directory.

Name : httpd
Arch : x86_64
Version : 2.2.3

CentOS 5.10
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 5 apache name based virtual host not working smch1 Linux - Software 11 07-28-2011 09:33 AM
Virtual Host Configuration wisetech Linux - Software 2 02-23-2011 09:22 PM
Any way to tunnel apache virtual host to an internal apache? ciuly Linux - Server 5 01-31-2010 12:53 PM
multiple virtual host configuration in apache nthillaiarasu Programming 2 02-20-2009 05:10 PM
Apache Virtual Host Configuration Crashed_Again Linux - Networking 1 12-18-2002 01:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration