JohnWittle comments on Interested in learning Linux? Need hosting? Free shells! - Less Wrong

28 Post author: JohnWittle 09 September 2012 05:35AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (37)

You are viewing a single comment's thread. Show more comments above.

Comment author: JohnWittle 10 September 2012 07:41:51PM *  2 points [-]

Apache virtual hosts. For instance:

'johnwittle.com' is registered and has its A record pointed at the server, so when you type johnwittle.com into your browser, it goes to 98.158.26.222 (the ip of the server).

Now, apache, the webserver, has the following in its configuration files:

<VirtualHost *:80> #look for connections coming in on port 80
ServerName dbaupp.johnwittle.com #if the requested URL is this url...
DocumentRoot /home/dbaupp/www #...use this directory as root
</VirtualHost>

Then you just set up a virtualhost block for every domain/subdomain you want.

Comment author: [deleted] 10 September 2012 07:55:28PM 0 points [-]

and fcgi 404 handler or whatever would be set up similarly?

Comment author: JohnWittle 10 September 2012 08:37:36PM *  0 points [-]

the two lines i posted are the bare minimum needed to set a vhost. Things like 404 pages, per-vhost access and error logs, servername aliases (*.foo.com to www.foo.com), etc. are all possible.

Afaik, this is the standard method of going about doing this.