LAMP 一键安装包 网址:https://lamp.sh/install.html
LAMP安装时间过长请不要用xshell安装容易断线,在虚拟机本机安装。
安装 wget、screen、unzip,创建 screen 会话
yum -y install wget screen git
git clone 并赋予脚本执行权限
git clone https://github.com/teddysun/lamp.git
cd lamp
chmod 755 *.sh 给权限
开始安装
screen -S lamp
./lamp.sh
安装选项
最后这里回车确认,有信息动了就等待安装,时间较长可以去睡一觉。
安装完毕后启动 httpd 服务
systemctl start httpd
查看是否启动 ,如有绿色表示启动成功
systemctl status httpd
查看firewall服务状态
systemctl status firewalld
关闭防火墙
service firewalld stop
网页测试输入你的ip:192.168.0.102
完成LAMP安装
添加配置 Mysql 用户,记住在mysql里面命令结束必须加上( ;)这个符号才能执行命令
安装模块
yum install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-mcrypt
osTicket 官网下载,解压到win10系统下
把以下文件导入centos系统 /data/www/default 目录里
scripts
upload
scripts,upload 给权限
chown apache -R /data/www/default/upload
chown apache -R /data/www/default/scripts
到以下目录cp拷贝文件以下命令
cd /data/www/default/upload
cp include/ost-sampleconfig.php include/ost-config.php
启动mysql
systemctl start mysqld.service
登入数据库需要更改mysql密码,以下提示错误信息
mysql -u root -p
编辑etc/my.cnf文件添加 skip-grant-tables 免密码登入mysql
systemctl restart mysqld 重启
再登入 mysql -u root -p 以下是更改Mysql密码,以下红色筐是成功信息
update mysql.user set password=password('123') where user='root' and host='localhost';
flush privileges;
exit;
再编辑etc/my.cnf文件删除或注释这条命令 skip-grant-tables
以下添加用户
create database osticketdb;
create user "osuser"@"localhost" identified by "password";
grant all on osticketdb.* to "osuser"@"localhost";
flush privileges;
exit;
配置 文件default.conf重命名为www.a.com.comf
cd /usr/local/apache/conf/vhost/default.conf
把原文件的内容删除,添加以下内容进去保存退出!
DocumentRoot "/data/www/default/"
ServerName www.a.com
ServerAlias www.a.com
ErrorLog "/var/log/httpd/yourdomain.com-error_log"
CustomLog "/var/log/httpd/yourdomain.com-access_log" combined
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
systemctl restart httpd.service 重启服务
chown apache -R /data/www/default/upload
重启httpd服务
systemctl restart httpd.service
访问 :192.169.0.117/upload
管理原用户的账号密码自己设置记住!
查询Mysql数据库名
show databases;
已经安装完成准备进入工单系统
访问 :192.169.0.117/upload
登入管理用户需要更改配置文件,不然没有东西(注意语法符号位置都要一模一样)
到以下路径找到配置文件添加内容
/data/www/default/upload/include
配置class.ostsession.php文件添加
$this->data->session_data = "";
保存退出,重启服务
systemctl restart httpd.service
完成!