安装所需的开发工具:
1、gcc automake autoconf libtool make gcc-c++
yum -y install gcc automake autoconf libtool make gcc-c++
2、mysql mysql-devel
yum -y install mysql mysql-server mysql-devel
3、lua lua-devel lua-guestfs lua-static(带lua脚本的需要)
yum -y install lua lua-devel lua-guestfs lua-static
4、curl libcurl libcurl-devel
yum -y install curl libcurl libcurl-devel
5、cJSON
yum -y install git
cd /root/
git clone https://github.com/DaveGamble/cJSON.git //或者手动文件夹名cJSON 上传到/root
sudo cp -R cJSON/ /usr/include/
cd /usr/include/cJSON
make
make install
6、zlib
cd /root/
git clone https://github.com/madler/zlib.git //或者手动进文件夹名zlib 上传到/root
sudo cp -R zlib/ /usr/include/
cd /usr/include/zlib
chmod +x configure
./configure; make test
make install
cp zutil.c zutil.h /usr/local/include
四、完毕,可以正常编译。
make clean
make depend
make
搭建部分
# 启动
service mysqld start
# 设置root密码
mysqladmin -u root password 密码
# 连接管理员 输入密码
mysql -uroot -p -h localhost
选择 mysql
mysql> use mysql;
接着对系统数据库的root账户设置远程访问的密码,与本地的root访问密码并不冲突
mysql>grant all privileges on *.* to ‘root’@’%’ identified by ‘password’ with grant option;
mysql>flush privileges;
退出 mysql
mysql>quit;
重启 MySQL 服务即可完成
service mysqld restart
开放数据库3306端口
iptables -I INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
service iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]
service iptables restart
使用Navicat for MySQL连接数据库导入sql
chmod -R 777 /root/CSA/saac
chmod -R 777 /root/CSA/gmsv
开放服务端XXXX端口
iptables -I INPUT -m state –state NEW -m tcp -p tcp –dport XXXX -j ACCEPT
service iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]
service iptables restart
./saacjt
./gmsvjt