Is this the right way for this? Site building with no domain
I started this VPS to see if it would be better for a friend's site that is on a shared server right now.
I figured out that
Is this the best way to test web sites before adding it to my virtual hosting and pointing the DNS for it? I planned on downloading all the current files and exporting the databases, and then uploading them/importing them to the above directory, but not sure if there is a better way (or safer way, if it applies) of doing this.
5 Replies
Assuming you are running Apache (which seems safe), when you type the URL:
http://
Apache will return the index page for the default server. This will be pointed at whatever directory you have configured Apache to use. If you use the URL:
http://
This much you seem to understand properly, at least in practice.
The next idea, which you haven't yet gotten to, is virtual servers. A virtual server can be reached by either a unique name or a unique IP address. In your case, the servers will be names which all resolve to the same IP address. So, there is NO essential difference, EXCEPT that instead of requiring a
Given all this, here is my suggestion: Place the various sites in a hierarchy that isn't a child of your default site. I use:
/usr/local/www/sites/
Hope this addresses your concerns.
I should mention I already have a domain hosted, so going to http://
Now, for the "temp-site", I have it in /var/www/
If I understand correctly, I can place the "temp-site" site in any other folder (will probably use the usr folder), and I understand what symlink does, but confused on one other area…
So, lets say I place the temp site, using your example, in /usr/local/www/sites/
None of this will be a problem for me once I am ready to point the domain to my new VPS here, just don't want to do it yet of course because it is a live site hosted elsewhere.
Create a directory /srv/www/
When you are ready, create a virtual server pointed at /srv/www/
ln -s /usr/lcoal/www/sites/loj/* /var/www/loj/
I placed an index.html file into the folder /usr/local/www/sites/loj/ and now it seems to work:
Anything I need to worry about with permissions? Also, should I scrub my actual folder info and IP info from this post?
> Anything I need to worry about with permissions?
Basic security-wise, the goal always seems to just be "turn off write everywhere you can", making sure the web server can't access anywhere it shouldn't is the key of course. Users not gaining access to each other's directories is another nice bonus, one that's a little scarily often missed by smaller hosts.
Certain apps using PHP and such will need write access to certain files for logs or cache or temporary space, things like that, but they'll usually point those out for you in their install docs pretty clearly.
If you want to give the users FTP access you're going to need to make sure they own their directories properly and things are appropriately set up so that uploaded files go into their ownership, setgid and setuid for group and user permissions at least.
I always used to forget this step, you want 'setuid'/'setgid' on the directory so that files added inherit these attributes. ( chmod 6755 and umask 0022 are pretty typical ways I think )
> Also, should I scrub my actual folder info and IP info from this post?
Couldn't hurt, right? Should keep you safe, at least until those crazy spies hear about Google cache or the internet archive!