By heaversm
I am using a LAMP stack on Ubuntu 14x.
I want to use my server’s ip address/subfolder as a “root” domain (http://1.2.3.4/[client]), without using fully qualified domains (www.domain.com).
How do I set this up?
I read about using the apache userdir module, which seems like it would work, but I don’t know how to add users.
I also read about setting up virtual hosts, but it seems like that only applies if you are using fully qualified domain names(?)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
You can use IP addresses in virtual hosts too, e.g.:
<VirtualHost *:80>
ServerName 1.2.3.4
</VirtualHost>
For the userdir module:
sudo a2enmod userdir
sudo service apache2 restart
Apache uses the users on your droplet, so to add others:
sudo adduser newuser
… which creates the directory /home/newuser
sudo mkdir /home/newuser/public_html
sudo chmod 0755 /home/newuser/public_html
Apache will now serve files out of /home/newuser/public_html at the address http://1.2.3.4/~newuser.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.