Pregunta

I'm very new to Linux, please bear with me.

I have a linode with a LAMP stack running and I managed to configure my main site and a couple of subdomains and it's working great.

However, I want to have a dir called "dev" where I can put projects that I'm still working on. I need to be able to access this folder from my browser's address bar, and I don't want it to be through a DNS, but directly from my server's IP. For example:

http://218.42.42.42/dev/someproject

Since the document root is set to /var/www, placing the "dev" folder there isn't really an option - I want it to be in my ~ folder, for easier backups.

So what's the best way to make this work? A redirect, or should I move my doc root to the "dev" folder?

Thanks!

¿Fue útil?

Solución

First, this would probably be more appropriate for Serverfault. With that in mind...

If I had to keep my dev environment in my home folder, I'd create a symlink in /var/www that ties to the dev folder.

As far as securing it, I don't know if this is still a recommended or viable way of handling secure access, but it seems like http://www.codinglogs.com/blog/server-management/vps-setup-guide/nginx-password-protect-web-directory might be the way to go as long as you feel secure using a username/password combination. Another valid answer (also on stackoverflow) would be password protect /backoffice folder in nginx.

If you want something more secure, the next step would probably firewall rules.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top