系统环境
centos 6.5
依赖环境
nginx
安装ngnix
yum install nginx #安装nginx,根据提示,输入Y安装即可成功安装
service nginx start #启动
chkconfig nginx on #设为开机启动
/etc/init.d/nginx restart #重启
nginx默认站点目录
/usr/share/nginx/html/
mysql
安装mysql
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,可以远程访问
重启mysql
/etc/init.d/mysqld stop #停止
/etc/init.d/mysqld start #启动
service mysqld restart #重启
php
安装php
yum install php
安装PHP组件,使PHP支持 MySQL、PHP支持FastCGI模式
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 #设置开机启动
phpmyadmin
安装
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
下载
安装
安装插件
存放目录
/data/projects/osTicket/upload/include/plugins
安装语言包
存放目录
/data/projects/osTicket/upload/include/i18n
``
配置
nginx
vim /etc/nginx/conf.d/osticket.conf
server {
listen 80;
server_name ticket.example.com;
root /data/projects/osTicket/upload;
access_log /var/log/nginx/ticket-console-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
站点访问
参考
资源