Linux下编写自动安装mysql apache php脚本
Linux下编写自动安装mysqlapachephp脚本要源码的要求路径变量不要复制过来的东西带说明代码说明...
Linux下编写自动安装mysql apache php脚本要源码的
要求路径变量
不要复制过来的东西
带说明代码说明 展开
要求路径变量
不要复制过来的东西
带说明代码说明 展开
2个回答
2013-09-21
展开全部
1.1 编译安装
# groupadd mysql
# useradd -g mysql -d /usr/local/lib/mysql -s /sbin/nologin mysql
# tar zxvf mysql-x.x.x
# cd mysql-x.x.x
# ./configure --prefix=/usr/local/lib/mysql --localstatedir=/usr/local/lib/mysql/data --with-charset=utf8 --with-extra-charsets=all
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /usr/local/lib/mysql
# mkdir data
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# echo "/usr/local/lib/mysql/bin/mysqld_safe &" >> /etc/rc.local
# /usr/local/lib/mysql/bin/mysqld_safe --user=mysql &
1.2 进入mysql的DBMS
# /usr/local/lib/mysql/bin/mysql -u root -p
enter password: <Enter>
*注:默认mysql的root用户口令为空
1.3 mysql数据在页面显示为中文乱码的问题
--with-extra-charsets=all是解决中文乱码的关键参数,它的作用是安装额外的字符集,其中即包括gbk等中文字符集。在创建数据库时手工指定字符集为gbk,这样就可以保证同样使用gbk字符集的HTML页面正常地显示中文了:
create database <db_name> default character set gbk collate gbk_chinese_ci;
2. 安装Apache
===============
2.1 编译安装
# tar zxvf httpd-x.x.x.tar.gz
# cd httpd-x.x.x
# ./configure --prefix=/usr/local/lib/apache --enable-so --enable-mods-shared=all --enable-rewrite=shared --enable-speling=shared
# make
# make install
2.2 apache启动停止命令
# /usr/local/lib/apache/bin/apachectl start
# /usr/local/lib/apache/bin/apachectl stop
# /usr/local/lib/apache/bin/apachectl restart
2.3 自动运行
# echo "/usr/local/lib/apache/bin/apachectl start" >> /etc/rc.local
2.4 apache启动时可能出现的错误
[Fri Dec 30 09:35:01 2005] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
# groupadd mysql
# useradd -g mysql -d /usr/local/lib/mysql -s /sbin/nologin mysql
# tar zxvf mysql-x.x.x
# cd mysql-x.x.x
# ./configure --prefix=/usr/local/lib/mysql --localstatedir=/usr/local/lib/mysql/data --with-charset=utf8 --with-extra-charsets=all
# make
# make install
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /usr/local/lib/mysql
# mkdir data
# bin/mysql_install_db --user=mysql
# chown -R root .
# chown -R mysql data
# chgrp -R mysql .
# echo "/usr/local/lib/mysql/bin/mysqld_safe &" >> /etc/rc.local
# /usr/local/lib/mysql/bin/mysqld_safe --user=mysql &
1.2 进入mysql的DBMS
# /usr/local/lib/mysql/bin/mysql -u root -p
enter password: <Enter>
*注:默认mysql的root用户口令为空
1.3 mysql数据在页面显示为中文乱码的问题
--with-extra-charsets=all是解决中文乱码的关键参数,它的作用是安装额外的字符集,其中即包括gbk等中文字符集。在创建数据库时手工指定字符集为gbk,这样就可以保证同样使用gbk字符集的HTML页面正常地显示中文了:
create database <db_name> default character set gbk collate gbk_chinese_ci;
2. 安装Apache
===============
2.1 编译安装
# tar zxvf httpd-x.x.x.tar.gz
# cd httpd-x.x.x
# ./configure --prefix=/usr/local/lib/apache --enable-so --enable-mods-shared=all --enable-rewrite=shared --enable-speling=shared
# make
# make install
2.2 apache启动停止命令
# /usr/local/lib/apache/bin/apachectl start
# /usr/local/lib/apache/bin/apachectl stop
# /usr/local/lib/apache/bin/apachectl restart
2.3 自动运行
# echo "/usr/local/lib/apache/bin/apachectl start" >> /etc/rc.local
2.4 apache启动时可能出现的错误
[Fri Dec 30 09:35:01 2005] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
2013-09-21
展开全部
呵呵 你真会省事 输命令不就完了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询