Any apache (web server) folks?

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
I'm running apache2 on a fc6 server. I have 3 websites that I want to publish. I have one in /var/www/html, I have 2 subdirectoris in html /var/www/html/site1and /var/www/html/site2

The site in html comes up fine, but for the others I just want http://mysite.com/site1 and http://mysite.com/site2
But to get them to work, I have to add a /index.php to the end of the url htp://mysite.com/site1/index.php

And it's not so much that I care that the index.php is there, but do I get it to work?

I know it must be something in apache, httpd.conf, but do I add a virtual host, or a directory.....

the dataroot is /var/www/html in httpd.conf
 

rogerwa

Commander
Joined
Nov 29, 2000
Messages
2,339
Re: Any apache (web server) folks?

Did you add index.php to the DirectoryIndex section of the httpd.conf?? Not sure if that only applies to the directory root.

Not an expert of any kind, I just dabble..
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

Yes I did, I put it in front of index.html, but thank you for the idea! Keep them coming. I'm just learning myself, we all have to, same with boats or anything.
 

rogerwa

Commander
Joined
Nov 29, 2000
Messages
2,339
Re: Any apache (web server) folks?

Add additional Directory directive for the additional subdirectories?? Or add a wildcard to the existing one.

Example:

<Directory /var/www/html/*>

</Directory>
 

dolluper

Captain
Joined
Jul 19, 2004
Messages
3,904
Re: Any apache (web server) folks?

Hummm always nice to learn tricks
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

You'd only use the virtual host if you wanted:

http://site1.com & http://site2.com

And what rogerwa said.


I'll check this thread again tomorrow when I'm actually awake. PHP is working right?

Code:
<?
// info.php
 phpinfo();
?>
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

Thanks Roger, I'll give that a try today

php is working, and I will also try the VirtualHost as well, that is what I am looking to accomplish, thanks
 

rogerwa

Commander
Joined
Nov 29, 2000
Messages
2,339
Re: Any apache (web server) folks?

If I am not mistaken the virtual hos t requires unique IPs for each Vhost.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

I tried /var/www/html/* and that didn't work. I then tried a directory:
<Directory "/var/www/html/site1">
DirectoryIndex index.php
AcceptPathInfo on
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
and that didn't work either.
I am goiing to try the VH.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

Part of it is dns. I added the hosts and now I don't need the index.php at the end of the URL. But I still need to figure out the VH part.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

I have added the VH in httpd.conf and when I run /usr/sbin/httpd -S

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 site.site.com (/etc/httpd/conf.d/ssl.conf:81)
*:80 is a NameVirtualHost
default server site.site.com(/etc/httpd/conf/httpd.conf:993)
port 80 namevhost site.site.com(/etc/httpd/conf/httpd.conf:993)
port 80 namevhost site1.site.com(/etc/httpd/conf/httpd.conf:998)
port 80 namevhost site2.site.com(/etc/httpd/conf/httpd.conf:1003)
Syntax OK

but if I put http://site2.site.com in for a url, http://site.site still comes up.
Any idea's?
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

It's been a while since I set one up from scratch, but try this link. It's what got me through it.
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

rogerwa said:
If I am not mistaken the virtual hos t requires unique IPs for each Vhost.

Nope... With name based virtual host you can host many different domains on the same ip address.



BTW, is this for work or just learning? Windows? Linux?
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

Linux FC6, It's a test (play) server at work, but I'm teaching myself as I go along. I have 1 production linux server and I want to add a couple more sites to the same server. Thanks for the link, it's what I have been using.
Question, for NameVirtualHost *, to I change that to anything?
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

Now I remember reading FC6 earlier last night.

It can go either way with the * or with an IP address. Mine has both because I have a few sites that are e-commerce (need a static ip for their SSL certificate), but most of them are on the same IP.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

Got it!!

ServerName site.site.com:80 was commented out.

Thanks to all!!!
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

Very cool. I kinda went through the same thing back in the day. I was just learning. Now, picture those sites as seperate customers . Give them each FTP access to upload files to their web space. Extra points for giving them email service. Add webmail too. You'll also need to dabble in DNS to get all that working correctly. You'll soon see how for example Apache, PHP, MySQL, BIND, ProFTPD, Sendmail all work together. It will pay off big time to learn that stuff.

Having said all that. Check out CentOS + BlueQuartz. That'll let you do everything I mentioned and more and let you manage it from a web based gui. Really cool stuff. It's really fun to see all the mysteries of the internet unravel as you begin to learn the pieces that make it all work.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

So do you have to have enterpise to run it?

Anyone know anything about .htaccess? 2 of the 3 sites work fine. The third site, the only one with a .htaccess file, opens the main page, but nothing else. Just a blank page.

RewriteEngine on

# If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
# containing the path from your site root to elgg's root. e.g. If your site is
# http://example.com/ and Elgg is in http://example.com/elgg/, you might need
#
RewriteBase /elgg/
This is the only place I see where it would affect the site.
The elgg dir is in /var/www/html
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: Any apache (web server) folks?

Plainsman said:
So do you have to have enterpise to run it?

No. It's all on the iso. It's not packages for Linux. It's a distro that's setup out of the "box" for hosting.


Does it work if you take out the .htaccess temporarily?
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: Any apache (web server) folks?

If I rename the .htaccess file I get:
Elgg configuration error: .htaccess is missing. Please see INSTALL file.
 
Top