homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Apache2, Hold my hand please
I need super basic help for apache2 on Mac OS X 10.2.8
appleman58




msg:1495612
 1:07 am on Jan 17, 2004 (gmt 0)

Greetings, I have bitten off more than I can chew, I think. #1 This is what I want to do... Use my mac and apache2 to serve a "main website" Lets just say for all intents and purposes, "applemanswebhosting.com" Can I do this, and still set up and host websites for other clients? Will they be able to log in with their wysiwyg's? Is there a limit on how many sites I can host? Is this how virtual host works? I have tried to set this all up, but I am having trouble understanding the basics. Mostly the difference in " main server " and "virtual host" How would one recomend setting up the directorys on Mac OS X 10.2.8? I have several DNS names pointing to my IP and all that seems to be ok. Yes, I know, stupid basic stuff
We all gotta start somewhere Right? ...appleman58

 

isitreal




msg:1495613
 4:11 pm on Jan 19, 2004 (gmt 0)

I'm not very good at apache, this sample is from windows so you'd have to change the paths to unix paths. You find this file in the apache group folder, apache2/conf/httpd.conf. That's the apache configuration file. At the bottom of that file is your virtual host directory. You set it up like this:

### Section 3: Virtual Hosts
#
......

NameVirtualHost 127.0.0.1:80 #replace '127.0.0.1' with your IP address

##LOCALHOST##
<VirtualHost 127.0.0.1:80>
ServerName localhost
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/program files/apache group/apache2/htdocs"
</VirtualHost>

## site1.com ##
<VirtualHost yourIPaddress:80>
ServerName site1.com
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/site1"
<Directory "c:/site1">
AllowOverride None
</Directory>
php_value include_path ".;c:/site1/includes" #assuming you have php running
DirectoryIndex index.php index.html index.htm
</VirtualHost>

## site2.com ##
<VirtualHost yourIPaddress:80>
ServerName site2.com
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/site2"
<Directory "c:/site2">
AllowOverride None
</Directory>
php_value include_path ".;c:/site2/includes" #assuming you have php running
DirectoryIndex index.html index.htm
</VirtualHost>

Once you've changed the file, you have to stop and restart apache for these changes to register.

You can have the site folders anywhere you want although of course it makes sense to put them all in the same place, as long as the path is correct.

I believe allowoverride none refers to whether or not the site is allowed to use .htaccess files, these are set to not use htaccess files.

There may be some other unix things you have to do to get this working, but try it and see.
As I said, I'm not very good at apache, but maybe this will help you get started, and if I've made any mistakes in this explanation maybe someone can correct them.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved