[Shell] syntaxhighlighter_viewsource syntaxhighlighter_copycode
apt-get update -y
apt-get install nginx -y
/etc/init.d/nginx start
apt-get install mysql-server mysql-client -y
sed -i '/^exit/ i /etc/init.d/mysql start' /etc/rc.local
apt-get install php5 php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-pspell php5-recode php5-snmp php5-tidy php5-xmlrpc php5-sqlite php5-xsl -y
apt-get install spawn-fcgi -y
sed -i '$ i fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' /etc/nginx/fastcgi_params
sed -i '/cgi.fix_pathinfo=/ c cgi.fix_pathinfo=1;' /etc/php5/cgi/php.ini
sed -i '/^exit/ i /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 2 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid' /etc/rc.local
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 2 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid
apt-get install phpmyadmin -y
mkdir /var/www -p
ln -s /usr/share/phpmyadmin/ /var/www/
cd /var/www
wget --no-check-certificate -O nexusphp https://sourceforge.net/projects/nexusphp/files/latest/download
apt-get install unzip
unzip nexusphp
rm -rf nexusphp
mv nexusphp.v* nexusphp
chmod -R 755 /var/www
chown -R www-data:www-data /var/www
# 下面的具体配置参数请根据需要填写!
mysql -uroot -p
#这里会让你需要刚才安装Mysql设置的密码
show databases;
#先确定你想要创建的表,以免重复!
create database nexusphp;
use nexusphp;
set names utf8;
source /var/www/nexusphp/_db/dbstructure.sql;
#这里切记修改成实际路径。如果提示数据库版本有问题,可以通过升降MYSQL版本解决,当然也可以用PhpMyadmin导入解决!
quit;
rm -rf /etc/nginx/sites-available/default
vi /etc/nginx/sites-available/nexusphp
#把以下内容复制
server {
listen 80;
server_name nexusphp;
root /var/www/nexusphp;
location / {
index index.php;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
vi /var/www/nexusphp/config/allconfig.php
# 以下是NEXUSPHP的配置,请根据实际修改,修改这个文件 在ubuntu下面同样是用的命令行来改,用vi命令 具体用法百度。
$BASIC=array(
'SITENAME'=> 'Nexusphp',
'BASEURL'=> '115.28.146.65',
'announce_url'=> '115.28.146.65/announce.php',
'mysql_host'=> 'localhost',
'mysql_user'=> 'root',
'mysql_pass'=> '123456',
'mysql_db'=> 'nexusphp',
);
ln -s /etc/nginx/sites-available/nexusphp /etc/nginx/sites-enabled/
sed -i '/^exit/ i /etc/init.d/nginx start' /etc/rc.local
/etc/init.d/nginx restart
好了,PT环境搭建完成,现在就可以用浏览器访问了,如:http://115.28.146.65/
PS:此时NEXUSPHP还没有管理员帐号哦!下面就选其他一个用户作管理员吧!
mysql -uroot -p
use nexusphp;
update users set class=16 where username='root';
quit;
# 当然其实你可以直接在PhpMyadmin中运行Sql:update users set class=16 where username='root'
# 有了第一管理员之后,你就直接可以在Nexusphp管理帐号等级了!