当前位置:主页   - 电脑 - 操作系统 - 其它系统
Ubuntu下构建LAMP服务器
来源:网络   作者:来源:网络/责编:编程入门 olddocks    更新时间:2010-09-26
收藏此页】    【字号    】    【打印】    【关闭

Build Your OwnDebian/Ubuntu LAMP Server - Quick & Easy Do it Yourself Installation

  • Apache 2 - Linux Web server
  • MySQL 5 - MySQL Database Server
  • PHP4/5 - PHP Scripting Language
  • phpMyAdmin - Web-based database admin software.

    Note: Linux + Apache + MySQL + PHP/Perl together commonly known as LAMP Server.

    First, let us prepare a system that has a minimum requirement of Debian/Ubuntu version of linux with atleast 256MB of RAM available. Anything less than this minimum ram will cause lot of problems since we are running a server along especially mysql and webmin requires lot of RAM to run properly. Mysql will give you this nasty error "cannot connect to mysql.sock" if you dont have enough memory in your server.

    I love debian/ubuntu based linux because of my enormous affinity towards this command apt-get. As a starter knowing this one command, It is so easy to install packages and you dont need to worry about package dependency and configuration. You need to buy a dedicated server or a VPS package if you want to setup your own server. If you want to experiment with the server and installation it is recommended to buy a vps package from various hosts. I prefer vpslink because of their pricing. Believe it or not it is so easy to install and configure your server yourself eventhough you are new are to linux and dedicated/vps hosting.

    First download PuTTy if you are accessing your server through SSH. Just enter the IP of your server with root login to access your host. As you probably know, Webmin is a freely available server control panel and we will setup this once we have completed the LAMP server and Mail Server. Webmin makes more easier for us to fine tune our linux box.

    Before proceeding to install, update the necessary packages with debian with this command.

    apt-get install update

    1. Installing Apache + PHP

    Apache is one of the most famous web server which runs on most linux based servers. With just few commands you can configure apache to run with PHP 4 or PHP 5.

    If you want to install PHP 4, just apt-get

    apt-get install apache2 php4 libapache2-mod-php4

    To install PHP5, just run the following on linux shell. Note that if you dont specify packages with '4', PHP5 will be automatically installed.

    apt-get install apache2 php5 libapache2-mod-php5

    Apache configuration file is located at: /etc/apache2/apache2.conf and your web folder is /var/www.

    To check whether php is installed and running properly, just create a test.php in your /var/www folder with phpinfo() function exactly as shown below.

    nano /var/www/test.php

    # test.php
    <?php phpinfo(); ?>

    Point your browser to http://ip.address/test.php or http://domain/test.php and this should show all your php configuration and default settings.

    You can edit necessary values or setup virtual domains using apache configuration file.

其它资源
来源声明

版权与免责声明
1、本站所发布的文章仅供技术交流参考,本站不主张将其做为决策的依据,浏览者可自愿选择采信与否,本站不对因采信这些信息所产生的任何问题负责。
2、本站部分文章来源于网络,其版权为原权利人所有。由于来源之故,有的文章未能获得作者姓名,署“未知”或“佚名”。对于这些文章,有知悉作者姓名的请告知本站,以便及时署名。如果作者要求删除,我们将予以删除。除此之外本站不再承担其它责任。
3、本站部分文章来源于本站原创,本站拥有所有权利。
4、如对本站发布的信息有异议,请联系我们,经本站确认后,将在三个工作日内做出修改或删除处理。
请参阅权责声明