I'm trying to setup 2 websites on my server ---> A_website and B_website

I don't have a domain name registered and I just want to use the site privately so I'll be accessing it via the static IP address that my ISP gave me.

I have installed a fresh Ubuntu 13.04 server and I have installed fresh Nginx + PHP + MySQL by referencing from the following website.

How do I go about setting/configuring my Nginx so that I can access my websites by typing the following in the browser URL box: my.isp.address/A_website/index.html and my.isp.address/B_website/index.html?

Currently it's still pointing to the default Nginx site folder /usr/share/nginx/html/.

Create a folder called A_website and a folder called B_website inside /usr/share/nginx/html/. Put the files for each "site" in their own folder.

If you actually want them to be separate sites rather than directories on the same site, you would have to set up two separate instances of your server operating on different ports with different working directories. Then instead of the subdirectory thing you described you would use the IP with the port specified at the end. I don't know how to do that with Nginx, but I think Cherokee can do it easily through its administration interface. EDIT: not that you should switch servers just for this hack. You probably don't even need this.

  • I'll try that....does .htaccess security work with this setting?? – chandra Aug 17 '13 at 16:04
  • .htaccess isn't available in Nginx or Cherokee, and it isn't even relevant to this problem. I think you should try to take this Web hosting thing from the beginning, rather than jumping right to the end like this and confusing yourself. Learn how servers work, which one is for you, and things like that. – Wutaz Aug 17 '13 at 16:11
  • @chandra .htaccess doesn't work here, all the security and configurations have to be done in the nginx configuration files. I would suggest that you follow Wutaz's advice and start from the beginning of web servers and start by maybe finding someone who can host the site for you so you don't have to worry about fiddling around with the configuration files. If that doesn't work and you need help with configuration files, though, you may want to read up on the NGINX wiki page about configuration and look at the "Start Here" links. – Thomas Ward Aug 17 '13 at 16:25

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.