Question

Need to change directory for the add on domain

I have pointed a domain from goddaddy to the droplet by changing the A record and now its working fine … but i want to change the directory for the domain its just opening 138.197.92.156 this but i want to open this 138.197.92.156/domain directory for the new domain

Show comments

Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

@geeber05

The directory that your web server pulls data from will be defined by your VirtualHost (Apache) or by a Server Block (NGINX).

If you’re using Apache, your VirtualHost files are stored in:

/etc/apache2/sites-available

If you’re using NGINX, your Server Block files are stored in:

/etc/nginx/sites-available

For Apache, you’d want to change the DocumentRoot directive.

For NGINX, you’d want to change the root directive.

So, for example, if you setup domain.com (example domain) to point to your Droplet, you’d modify one one of the above directives that corresponds to your domain and change the current path that’s set to the one you’d prefer to use.

By default, both Apache and NGINX setup the default configurations to use /var/www/html, so you would change to that your preferred path where your content is stored.

Once the changes have been made, and the file has been saved, you’d restart the web server.

service apache2 restart

or

service nginx restart

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.