网站架构采用LAMC,其中C为基于clearsilver的cgi技术。
Linux环境为Ubuntu 12.04
Apache
Mysql 版本为5.5
Apache安装:
1. sudo apt-get install apache
2. su
3. vim /etc/apache2/httpd.conf
4. sudo service apache restart
添加VirtualHost配置,示例:
<VirtualHost *:80>
ServerName www.hello.com
DocumentRoot /data/release/hello/htdocs/
ScriptAlias /cgi-bin/ /data/release/hello/cgi-bin/
<VirtualHost/>
Mysql安装:
- sudo apt-get install mysql-server mysql-client
- sudo apt-get install mysql-client
通过mysql -hlocalhost -uroot -p可以连接,但通过cgi程序进行连接时报错
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
解决办法:
1. 查看socket位置 mysqladmin variables | grep socket
2. 修改/etc/mysql/my.cnf配置
3. sudo service mysql restart
[mysqld]
socket=/tmp/mysql.sock
[client]
socket=/tmp/mysql.sock
Clearsilver安装:
1. 解压
2. ./confugure && make
3. sudo make install
至此,开发环境搭建完毕。