centos 6.5
yum install nginx #安装nginx,根据提示,输入Y安装即可成功安装
service nginx start #启动
chkconfig nginx on #设为开机启动
/etc/init.d/nginx restart #重启
/usr/share/nginx/html/
yum install mysql mysql-server #询问是否要安装,输入Y即可自动安装,直到安装完成
/etc/init.d/mysqld start #启动MySQL
chkconfig mysqld on #设为开机启动
cp /usr/share/mysql/my-medium.cnf /etc/my.cnf #拷贝配置文件(注意:如果/etc目录下面默认有一个my.cnf,直接覆盖即可)
shutdown -r now #重启系统
mysql_secure_installation
回车,根据提示输入Y
romote 那一步输入n,可以远程访问
/etc/init.d/mysqld stop #停止
/etc/init.d/mysqld start #启动
service mysqld restart #重启
yum install php
yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm
/etc/init.d/mysqld restart #重启MySql
/etc/init.d/nginx restart #重启nginx
/etc/rc.d/init.d/php-fpm start #启动php-fpm
chkconfig php-fpm on #设置开机启动
yum install phpmyadmin
安装后phpmyadmin目录在/usr/share/phpmyadmin/
vim /etc/nginx/conf.d/phpmyadmin.conf
server {
listen 80;
server_name phpmyadmin.example.com;
access_log /var/log/nginx/phpmyadmin-access.log main;
location / {
root /usr/share/phpmyadmin;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /usr/share/phpmyadmin;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
web访问phpmyadmin时,报错:配置文件现在需要绝密的短语密码(blowfish_secret)
vim /usr/share/phpmyadmin/config.inc.php
$cfg['blowfish_secret'] = 'x'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
osTicket/upload/include/plugins
[ldap]
[file upload]
/osTicket/upload/include/i18n
“
vim /etc/nginx/conf.d/osticket.conf
server {
listen 80;
server_name ticket.example.com;
root /osTicket/upload;
access_log /var/log/nginx/ticket-access.log main;
set $path_info "";
# Deny access to all files in the include directory
location ~ ^/include {
deny all;
return 403;
}
# Deny access to apache .ht* files (nginx doesn't use these)
location ~ /\.ht {
deny all;
}
# Requests to /api/* need their PATH_INFO set, this does that
if ($request_uri ~ "^/api(/[^\?]+)") {
set $path_info $1;
}
# /api/*.* should be handled by /api/http.php if the requested file does not exist
location ~ ^/api/(tickets|tasks)(.*)$ {
try_files $uri $uri/ /api/http.php;
}
# /scp/ajax.php needs PATH_INFO too, possibly more files need it hence the .*\.php
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
set $path_info $1;
}
# Make sure requests to /scp/ajax.php/some/path get handled by ajax.php
location ~ ^/scp/ajax.php/(.*)$ {
try_files $uri $uri/ /scp/ajax.php;
}
# Set index.php as our directoryindex
location / {
index index.php;
}
# Send php files off to the PHP-FPM listing on localhost:9000
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
include fastcgi_params;
}
}
重启服务
service nginx restart
[osTicket URL](
http://ticket.console.ksyun.com/)
CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)
配置文件现在需要绝密的短语密码(blowfish_secret)的解决方法
Minor issue - Apache error logs : client denied by server config /var/www/config/scp
Error when accessing some internal ajax uri
Doesn’t work on NGINX due to use of .htaccess files and relying on PATH_INFO