Jump to content

Recommended Posts

hello all,

 

well i have a webserver that i'm working on. now for all my websites i used apache/php/mysql. my question is how do i host three or multiple website in my server using apache as a server with php/mysql? no i have to set it up in the config file for apache if so how would i go about that?

Link to comment
https://forums.phpfreaks.com/topic/114907-hosting-multiple-sites/
Share on other sites

go to the site that you registered your domain at and change the nameservers(dns) to your server's nameserver. Then you should be able to change a setting in your domain where you can "add domain" and in there, you'd specifiy the domain, and then create an ftp user, and then it'd create a folder in your main directory with where that new website's files would be located

You will need to look at apache vhost configuration. Its quite simple but the location of where to put your vhosts can be different depending on how apache has been setup.

 

For me, I have a seperate file for each vhost contained within /etc/apache/vhosts, then I have the following line....

 

Include /etc/apache/vhosts/*.conf

 

in my /etc/apache/httpd.conf file.

 

From there each site has its own config, eg;

 

/etc/apache/vhosts/foo.conf

<VirtualHost *>
ServerName foo.com
ServerAlias www.foo.com
DocumentRoot /var/www/foo
<Directory />
	Options FollowSymLinks
	AllowOverride None
</Directory>
<Directory /var/www/foo>
	Options Indexes FollowSymLinks MultiViews
	AllowOverride None
	Order allow,deny
	allow from all
</Directory>
ErrorLog /var/log/apache2/foo-error.log
LogLevel warn
CustomLog /var/log/apache2/foo-access.log combined
</VirtualHost>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.