LNMH: High-performance VPS hosting environment

LNMH: High-performance VPS hosting environment

LNMH is an architecture based on Nginx combined with HHVM, and is characterized by high efficiency. The following is the construction process.

HHVM official website (blocked): http://www.hhvm.com
HHVM Github: https://github.com/facebook/hhvm

1. Install HHVM
1. CentOS
rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
cd /etc/yum.repos.d
wget http://www.hop5.in/yum/el6/hop5.repo
yum clean all
yum -y remove libevent-devel libevent
yum -y install hhvm –setopt=protected_multilib=false
2. debianxia
sudo apt-get update
wget http://dl.hhvm.com/conf/hhvm.gpg.key
sudo apt-key add hhvm.gpg.key
echo "deb http://dl.hhvm.com/debian wheezy main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y hhvm

2. Install Fastcgi
sudo /usr/share/hhvm/install_fastcgi.sh #Install Fastcgi
sudo update-rc.d hhvm defaults #Add to boot
sudo service hhvm restart #Restart HHVM

3. Install LNMP (optional)
wget http://blog.linuxeye.com/lnmp.tar.gz

wget http://blog.linuxeye.com/lnmp-full.tar.gz # Contains source code (official download is too slow)

tar xzf lnmp.tar.gz
cd lnmp

If you need to modify the directory (installation, data storage, Nginx log), please modify the options.conf file

./install.sh
Only Nginx and memcached are installed.

4. Modify the vhost.sh file to allow nginx to add Fastcgi when adding a virtual machine.
Found (around line 314)
[ ! -d $web_install_dir/conf/vhost ] && mkdir $web_install_dir/conf/vhost
cat > $web_install_dir/conf/vhost/$domain.conf << EOF server { listen 80; server_name $domain$moredomainame; $N_log index index.html index.htm index.jsp index.php; include $rewrite.conf; root $vhostdir; #error_page 404 /404.html; if ( \$query_string ~ “. [;'&lt;&gt;].*” ){

 return 404; }

$anti_hotlinking
echo -e $ngx_pagespeed
location ~ .*.(php|php5)?$ {

 #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }


Change to
[ ! -d $web_install_dir/conf/vhost ] && mkdir $web_install_dir/conf/vhost
cat > $web_install_dir/conf/vhost/$domain.conf << EOF server { listen 80; server_name $domain$moredomainame; $N_log index index.html index.htm index.jsp index.php; include $rewrite.conf; root $vhostdir; #error_page 404 /404.html; if ( \$query_string ~ “. [;'&lt;&gt;].*” ){

 return 404; }

$anti_hotlinking
echo -e $ngx_pagespeed
location ~ .*.(php|php5)?$ {

 fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/hhvm/hhvm.sock; fastcgi_index index.php; include fastcgi.conf; }

5. Modify the nginx.conf file to find

pureftpd AND phpmyadmin

 location ~ .*\.(php|php5)?$ { #fastcgi_pass remote_php_ip:9000; fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }


Change to

pureftpd AND phpmyadmin

 location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/dev/shm/php-cgi.sock; fastcgi_index index.php; include fastcgi.conf; }

Restart Nginx:
service nginx restart

6. Install MySQL database
apt-get install mysql-server

via:deamwork

<<:  Domestic browser international version

>>:  vpsGOD: $25/year/256MB memory/10GB space/100GB traffic/KVM

Recommend

TOSHOST:$15/year/1CPU/256M/10G/200G/1 IP/OpenVZ

TOSHOST是2012年7月成立的美國主機商,提供各類型主機,其VPS性價比較高,最新推出的優惠...

FirstVDS: $1.5/month/512MB RAM/10GB storage/unlimited traffic/OpenVZ/Russia

FirstVDS, a Russian hosting provider, was founded...

UnRealServers: $12.5/month/L5420/8G memory/500GB hard disk/20TB traffic/Kansas

UnRealServers, an American hosting provider, was ...

TurnKey Internet 4GB RAM KVM VPS California Simple Review

Details: https://www.turnkeyinternet.net/cloud-ho...

Hostodo: $21/year/4GB RAM/50GB storage/2TB bandwidth/OpenVZ/Los Angeles

Hostodo, which has been introduced many times, no...

LoveServers: $5/month/512MB memory/250GB space/1TB traffic/KVM/UK

LoveServers, a British hosting provider, was foun...