Installing Apache MySQL, PHP and phpmyadmin on Ubuntu10.10 Maverick Meerkat is far easier and less complicated than doing the same on Fedora 13, (my own experience). Step 1:You start by installing mysql
Specify new password for the MySQl “root” user when prompted. Repeat it for a second time and you would have MySQL server and client installed. Step 2:Next, installApache2:
And you get apache2 installed as well. To double check, point your browser to http://localhost, and you should see the Apache2 placeholder page like this. Step 3:To install support for PHP, do the usual
To verify that everything installed correctly and php support is enabled, you need torestart apacheby doing this
Create a test php file called info.php, using a text editor of your choice (say gedit)
and paste the following content and save the file <?php phpinfo(); ?> Now open the following page http://localhost/info.php and you should see something like this Step 4:To make MySQL, php and apache talk among themselves, you would have to install php5-mysql, below I am listing some more useful packages that you might want to install
Now refresh the info.php page that you have open in your browser and you should be able to see the support for mysql if you search for it by doing Ctrl+f, but before that don’t forget to restart apache again (sudo /etc/init.d/apache2 restart) Step 5:Finally install phpmyadmin
It would ask if you want to configure it automatically for apache or lightppd choose apache (by pressing “spacebar” to display a star as shown below and then use tab to navigate to Ok and press enter. It would be automatically configured, however it would ask if you want a database installed and configured, chooseyesand press enter On the next screen you would be asked to enter the MySQL root password, that you provided in first step next it would ask you to enter a password to be used by phpmyadmin to register with thedatabase(basically it would create a user called “phpmyadmin” the password is for that, most likely you won’t be needing this password ever. You can even choose to assign a random password for it. Confirm that password on the next screen. Once you have made your choices the installation would finish and you should be able to access phpmyadmin by pointing your web browser to http://localhost/phpmyadmin/
ubuntu 10.4 的 http://www.oschina.net/bbs/thread/10794 http://blog.myspace.cn/e/407367767.htm 安装 当然不使用Gnome,使用终端命令也很简单: 设置Ubuntu文件执行读写权限 LAMP组建安装好之后,PHP网络服务器根目录默认设置是在:/var/www。由于Linux系统的安全性原则,改 目录下的文件读写权限是只允许root用户操作的,所以我们不能在www文件夹中新建php文件,也不能修改和删除,必须要先修改/var/www目录的 读写权限。在界面管理器中通过右键属性不能修改文件权限,得执行root终端命令: 如何安装phpmyadmin-Mysql 数据库管理 使用界面管理器: phpmyadmin设置: phpmyadmin测试:在浏览器地址栏中打开http://localhost/phpmyadmin。 Ubuntu LAMP 如何配置Apache 1. 启用 mod_rewrite 模块 Apache重启后我们可以测试一下,在/var/www目录下新建文件test.php,写入代码: 2.设置Apache支持.htm .html .php LAMP配置之Mysql测试上面php,Apache 都已经测试过了,下面我们再测试一下Mysql 数据库是否已经正确启用。 在/var/www目录下新建 mysql_test.php:
保存退出,在地址栏输入http://127.0.0.1/mysql_test.php,显示"Mysql 已经正确配置"则表示OK了,如果不行,重启Apache服务器后再试一下。
命令行一条命令安装LAMP
$sudo tasksel 输入管理员密码后进入菜单 ,选择LAMP server 输入MySQL密码 程序开始下载,并安装完成。 安装完后在浏览器输入 Server地址,一般默认情况下输入127.0.0.1 出现 It works!This is the default web page for this server. The web server software is running but no content has been added, yet.
则表明Apache运行中。 接下来检查MySQL工作情况: 命令行输入: mysql -u root -p 如果运行正常如下 ander50@ander50-desktop:~$ mysql -u root -p 输入密码 配置概要
一、配置php5 命令:sudo gedit /etc/php5/apache2/php.ini 修改允许最大使用内存,查找 memory_limit = 8M 修改为 memory_limit = 32M upload_max_filesize = 2M 修改为 upload_max_filesize = 8M extension=mysql.so extension=gd.so 保存并关闭文件。 二、配置apache 1、ubuntu 中配置文件在/etc/apache2下,apache2.conf是全局配置或者说是主配置文件,httpd.conf是用户配置文件,感觉和用php 编写程序时经常用config.php覆盖config.default.php文件中的设置是一样的,用户设置独立出来,方便管理和备份,毕竟主配置文 件很少修改,偶尔修改一两句也可以写到httpd.conf里面,备份方便 在/etc/apache2/httpd.conf加入一行:ServerName 127.0.0.1 命令:sudo gedit /etc/apache2/httpd.conf
2、下面这段是在官网上找下来的 编辑/etc/apache2/apache2.conf(新安装的系统可能在/etc/apache2/conf.d/charset)文件,在改动之 前,请先将该配置文件做个备份。以便在出错的时候可以恢复。将 AddDefaultCharset ISO-8859-1 改为 AddDefaultCharset GB2312 当然如果你网站的编码用的是UTF-8的话,也可以改为 AddDefaultCharset UTF-8 这样的话,我们就不会每次打开网页都是乱码了! 3、增加安全模块,以保障Apache服务的正常运行,现在我们安装mod-security。(可选) a. 首先安装libapache2-mod-security包(7.10之后的系统已经没有此包,可以跳过此步骤) sudo apt-get install libapache2-mod-security a. 该模块默认是没激活的,我们可以在/etc/apache2/mods-available目录下看到有mod-security.load文件,但在 /etc/apache2/mods-enabled目录却没有它的软链接。我们现在激活它: $sudo a2enmod mod-security $sudo cp /usr/share/doc/libapache2-mod-security/examples/httpd2.conf.example-full /etc/apache2/mods-available/mod-security.conf $sudo cp /etc/apache2/mods-available/mod-security.conf /etc/apache2/mods-available/mod-security.conf.orig $sudo vi /etc/apache2/mods-available/mod-security.conf ==== mod-security.conf 文件内容开始==== # 检测内容长度以避免堆溢出攻击 SecFilterForceByteRange 32 254 =>SecFilterForceByteRange 32 126 # debug设置 SecFilterDebugLevel 9 =>SecFilterDebugLevel 0 # 设置缺省的动作 SecFilterDefaultAction "deny,log,status:499" =>SecFilterDefaultAction "deny,log,status:404" # 把设置传递给子目录 SecFilterInheritance Off # Redirect user on filter match # 当匹配sh的时候,重新定向到一个特殊的警告页面,该页面是自行编写的,写些警告的话让攻击者知难而退,该段先不要生效,等到相关配置配好之后再失效不迟。记住在配好之后要使之生效。 #SecFilter sh redirect:http://localhost/hack/warning.htm # Prevent OS specific keywords #过滤一些敏感的东西,我们使用*是为了攻击者使用/etc/./passwd来绕开检测 SecFilter /etc/passwd =>SecFilter /etc/*passwd SecFilter /bin/*sh # Very crude filters to prevent SQL injection attacks # 防止SQL插入(SQL Injection)攻击 SecFilter "delete[[[space|]]]+from" SecFilter "insert[[[space|]]]+into" SecFilter "select.+from" SecFilter "select[[[space|]]]+from" SecFilter "union[[[space|]]]+from" ==== mod-security.conf 文件内容结束==== sudo ln -s /etc/apache2/mods-available/mod-security.conf /etc/apache2/mods-enabled/mod-security.conf a. 重启Apache2服务即可。 sudo /etc/init.d/apache2 restart |
(转载)ubuntu 10.10 安装配置LAMP
最新推荐文章于 2024-11-13 20:36:39 发布
(转载)ubuntu 10.10 安装配置LAMP