• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

web server

Restarting Nginx

July 1, 2016

Niginx is primarily a web server, but it can also run as a proxy server, load balancer and a HTTP cache.

If you’re running on Debian, Ubuntu, Red Hat or CentOS, the following are several ways of restarting Nginx.

# /etc/init.d/nginx restart
# /etc/init.d/nginx reload
# service nginx restart
# service nginx reload
# nginx -s reload

# /etc/init.d/nginx restart # /etc/init.d/nginx reload # service nginx restart # service nginx reload # nginx -s reload

The last example is more universal and will run in any Linux flavor.

Filed Under: Linux Tagged With: nginx, web server

Dropbox Folder As Web Root

December 8, 2012

One of many clever ways you can do with Dropbox is to make it the web root of your development server. There’s an advantage to doing this, as I’ll explain in this post. Currently, I have Dropbox installed on my Linux Mint desktop. I also use the desktop as my web development server. I have Apache, PHP, MySQL, etc. installed. Typically the web root of the Apache web server, is located in the /var/www directory. I’ve changed mine to a Dropbox folder at /home/ulysses/Dropbox/web/.

There’s an advantage to making Dropbox the web root. I normally use multiple computers to code. I have a Linux desktop, Macbook Air, and a Windows machine. I installed Dropbox on all of them, and placed my code in a Dropbox folder to share files. My code is always synched on all computers. Each time I move to another computer, I can always access the same code, because Dropbox does a fantastic job of synching files on all my computers.

In addition, I made Dropbox the web root of my development server, so every time I make a file change, the development web server is also updated. So, there is no more need for me to FTP or copy files to my development server. One more thing, if my desktop is turned on at home, any changes I make away from home, are reflected on my development server instantaneously.

To change Apache’s web root, edit the /etc/apache2/sites-available/default config file. Change the default directory from /var/www to /home/ulysses/Dropbox/web/, the location of my Dropbox folder.

DocumentRoot /home/ulysses/Dropbox/web
<Directory />
 Options FollowSymLinks
 AllowOverride None
</Directory>
<Directory /home/ulysses/Dropbox/web/>
 Options Indexes FollowSymLinks Multiviews
 AllowOverride All
 Order allow,deny
 allow from all
</Directory>

DocumentRoot /home/ulysses/Dropbox/web <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/ulysses/Dropbox/web/> Options Indexes FollowSymLinks Multiviews AllowOverride All Order allow,deny allow from all </Directory>

Do the same for the /etc/apache2/sites-enabled/default config file.

Finally, restart Apache.

$ sudo /etc/init.d/apache2 restart

$ sudo /etc/init.d/apache2 restart

Filed Under: CSS, HTML, PHP Tagged With: apache, dropbox, web server

  • Home
  • About
  • Archives

Copyright © 2023