Tag Archives: Nginx

Nginx – Redirect a specific url

A client wants the old .aspx path could redirect the visitor to another URL. I don’t want to make the server to host a .aspx file so i add the redirection in the Nginx virtual host config.

Add the following lines insider the server { … }.

## Special redirect for the following
## old xxx.aspx to eureka.ykyuen.info
location /xxx.aspx {
  return 301 $scheme://eureka.ykyuen.info;
}

 

Done =)

Advertisement

Ubuntu – Recover package configuration file using apt-get

Previously i have setup a server with Nginx and MariaDB.
Run Drupal 7 in Nginx

But there is one problem in this setup. I cannot restart the MariaDB service. Whenever it is down, i have to restart the server instance.

At first, i thought the failure is caused by the modification of the /etc/mysql/my.cnf. So i try to restore the original my.cnf. The following solution helps you to restore the default package configuration file.
Continue reading Ubuntu – Recover package configuration file using apt-get

Run Drupal 7 in Nginx

After so many days we have talked about setting up Nginx, PHP-FPM, MariaDB and some PHP caching. We can now try to run a Drupal instance on them. Before we starts, let me listed out all the previous posts.

 

It’s time to start the Drupal installation.
Continue reading Run Drupal 7 in Nginx

Ubuntu – Install Memcached with PHP-FPM and Nginx

Previous: Ubuntu – Install APC with PHP-FPM and Nginx

Memcached is a distributed memory caching system and it caches data and objects in RAM to reduce the number of times an external data source (such as a database or API) must be read.

Like APC, the installation is simple.

1. Install Memcached.

  • apt-get install memcached

Continue reading Ubuntu – Install Memcached with PHP-FPM and Nginx

Ubuntu – Install APC with PHP-FPM and Nginx

Next: Ubuntu – Install Memcached with PHP-FPM and Nginx

APC stands for Alternative PHP Cache is a opcode which also known as machine code. The opcode is cached such that every time a request is sent to server, the same opcode is used until it detects a change in the PHP file.

Installation is easy and straight forward.

1. Install using apt-get.

  • apt-get install php-apc

Continue reading Ubuntu – Install APC with PHP-FPM and Nginx