Rootop 服务器运维与web架构

SUSE下搭建lamp环境

| 暂无评论

最近对SUSE产生了兴趣,正好看到腾讯云有优惠,遂买了一个折腾下。
opensuse:~ # dmidecode | grep “Product”
Product Name: HVM domU #腾讯的虚拟化

搭建个lamp平台
了解到suse下安装软件用zypper或者是yast
opensuse:~ # zypper install -y apache2  (install可以缩写为 in )
opensuse:~ # zypper in -y php5 php5-mysql apache2-mod_php5 php5-gd php5-mbstring php5-curl
opensuse:~ # service apache2 start (start/stop/restart/status)
opensuse:~ # zypper in -y MySQL-server-community
opensuse:~ # cp /usr/share/mysql/my-small.cnf /etc/my.cnf #默认不拷贝配置文件
opensuse:~ # service mysql start  (start/stop/restart/status)
opensuse:~ # mysql -V
mysql Ver 14.12 Distrib 5.0.26, for suse-linux (x86_64) using readline 5.1
发现版本好老

apache
默认apache主目录在  /etc/apache2/
默认网站根目录在      /srv/www/htdocs

php
默认主配置文件在   /etc/php5/apache2/php.ini

mysql
默认数据目录在      /var/lib/mysql (跟redhat一样)
默认主配置文件没有,手动拷贝到/etc/下

修改mysql默认存储引擎:
opensuse:~ # vi /etc/my.cnf
[mysqld]
default-storage-engine=InnoDB

保存退出重启mysql服务。
opensuse:~ # service mysql restart

修改mysql密码:
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password(‘root’) where user=’root’;
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

然后就找个php模板放上去,测试一下环境。

(suse的iptables发现好麻烦,没搞定还。默认腾讯云的iptables是清空规则的。)

SUSE关闭iptables:

suse下的iptables管理方式和rh不同
opensuse:~ # chkconfig –list | grep firewall
SuSEfirewall2_init 0:off 1:off 2:off 3:off 4:off 5:off 6:off
SuSEfirewall2_setup 0:off 1:off 2:off 3:off 4:off 5:off 6:off

opensuse:~ # SuSEfirewall2 status/start/stop
SuSEfirewall2: SuSEfirewall2 not active

原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/2640.html

作者:Venus

服务器运维与性能优化

发表回复