ubuntu server 10.04 安装 LAMP
来源:互联网 发布:淘宝店会员制度 编辑:程序博客网 时间:2024/06/06 08:44
1、安装软件:apt-get install apache2 mysql-server mysql-client php5 php5-gd php5-mysql
1> 可以打开http://127.0.0.1/ 说明apache已启动
2> 设置mysql root 密码 mysql亦已启动
2、设置www权限:
sudo ln -s /usr/share/phpmyadmin /var/www (非必须,好像不连接也能用的)
$link = mysql_connect("localhost","root","添入刚才设置的密码");
if (!$link)
{
die('Could not connect: ' . mysql_error());
}
else echo "Mysql Is Working";
mysql_close($link);
?>
/etc/mysql/my.cnf mysql配置文件
3、mysql相关文件:
/etc/php5/apache2/php.ini php配置文件
/etc/php5/conf.d/mysql.ini php支持mysql接口
参考:
http://blog.myspace.cn/e/407367767.htm
http://farlee.info/archives/ubuntu-server-install-lamp-phpmyadmin-vsftpd-zend-framework.html (内有乱码解决方案,挺好)
1> 可以打开http://127.0.0.1/ 说明apache已启动
2> 设置mysql root 密码 mysql亦已启动
2、设置www权限:
sudo chmod 777 /var/www
3、启用 mod_rewrite 模块
终端命令:sudo a2enmod rewrite
重启Apache服务器:sudo /etc/init.d/apache2 restart
1> php 设置成功
4、安装phpmyadmin (非必须,就是设置mysql比较容易点)
sudo apt-get install phpmyadmin 另外输入上面设置的mysql密码sudo ln -s /usr/share/phpmyadmin /var/www (非必须,好像不连接也能用的)
在/var/www内新建网页用于测试
1、
<?php phpinfo(); ?> 用来测试PHP是否好用
2、
<?php$link = mysql_connect("localhost","root","添入刚才设置的密码");
if (!$link)
{
die('Could not connect: ' . mysql_error());
}
else echo "Mysql Is Working";
mysql_close($link);
?>
测试mysql是否可用
其他测试:
netstat -tunl
查看 80端口和 3306端口即可知道 apache2 和 mysql 是否启动
相关配置文件:
1、apache2 相关文件:
/etc/apache2/apache2.conf apache配置文件
/etc/apache2/conf.d 自定义配置文件
/var/www 网页存放区
/usr/sbin/apache2ctl apache的执行文件
/usr/bin/htpasswd apache密码保护
2、mysql 相关文件:/etc/mysql/my.cnf mysql配置文件
3、mysql相关文件:
/etc/php5/apache2/php.ini php配置文件
/etc/php5/conf.d/mysql.ini php支持mysql接口
参考:
http://blog.myspace.cn/e/407367767.htm
http://farlee.info/archives/ubuntu-server-install-lamp-phpmyadmin-vsftpd-zend-framework.html (内有乱码解决方案,挺好)
0 0
- ubuntu server 10.04 安装 LAMP
- Ubuntu server 10.04安装配置lamp服务器
- Ubuntu上安装 LAMP Server
- Ubuntu Server 14.04 安装 LAMP
- Ubuntu Server 14.04 安装 LAMP
- Ubuntu 14.04 LTS Server 安装 LAMP Server
- Ubuntu 14.04 LTS Server 安装 LAMP Server
- 虚拟机安装Ubuntu Server,配置LAMP
- Ubuntu 10.04 安装测试LAMP
- 安装 Ubuntu Server 11.04 以及 LAMP 全过程截图
- 在 Ubuntu Server 16.04 LTS 上安装 LAMP
- Ubuntu Server系统下快速安装LAMP生产环境脚本
- lamp-server 源码安装
- ubuntu下LAMP安装
- Ubuntu下LAMP安装
- ubuntu安装lamp
- Ubuntu 安装LAMP
- Ubuntu安装LAMP
- 更新server的源 sources.list
- ubuntu10.04 sshd_config 配置文件 注解
- ubuntu server 10.04 samba 需要用户名和密码访问
- UIImage 保存为图片
- ubuntu server 配置samba遇到的问题
- ubuntu server 10.04 安装 LAMP
- ubuntu server 10.04 .htaccess认证
- ubuntu server 10.04 安装PHP强化模块
- 破解windows xp 登录密码
- 服务器80端口被占用的解决方案
- android代码混淆之Gson解析为null
- ubuntu server 10.04 NFS设置
- [摘录] ubuntu server 10.04 安装dhcp服务器
- 相关认识