FREEBSDB Famp Lamp Environment

Source: Internet
Author: User
Tags mysql client netcraft php and mysql

Make install clean
Make No_checksum=yes Reinstall clean
Make Force_pkg_register=yes Reinstall clean

famp Architecture 20141115 Lamp architecture has long been famous, so-called lamp architecture refers to the Linux+apache+mysql+PHP (or Python or perl) is a set of open-source software that is used to build dynamic Web sites or servers, and is itself a separate program, but because it is often used together, it has an increasingly high degree of compatibility, which together form a powerful Web application platform.    Obviously the lamp name comes from the first letter of each program, and each of these programs is open source software: Linux is open-source operating system, Apache is the most common Web server, MySQL is a relational database with Web-based management Add-ons, PHP is a popular object scripting language. In fact, the latter three can be installed across the platform, if the Linux system for the Windows operating system, it is called Wamp architecture, and if the Linux for the FreeBSD system, it is called Famp architecture.    It can be said that Famp has the same advantages as lamp. The software installation of FreeBSD is broadly divided into three types:1PKG Add directly installs the executable program. 2ports compile the installation. 3source installation. The following installation is in the FreeBSDTen. 1 version on the choice of the second installation method that is ports installation is completed, in fact, the choice of pkg mode, the installation after the configuration process is also roughly the same. Apache installation: Apache is a widely used WWW server software in UNIX systems. Based on the statistics of the Netcraft (http://news.netcraft.com/archives/web_server_survey.html), over 60% of the servers currently in the Internet are using Apache to provide Web browsing services. Apache can be said to be the most widely used Web server software in the world, it can not only run on FreeBSD, UNIX, Linux, but also be installed in the Windows operating system. Apache, like FreeBSD, also has multiple branches on the software version, with only 2.2 and 2.4 versions currently in FB10.1. FreeBSD default Use apache-2. Version 4. It is very convenient to install Apache software on FreeBSD, the following is installed using ports method: # CD/usr/ports/www/Apache24 # Make install clean the following are some of the problems that you will often encounter in your actual use:1location of the configuration file: located in FreeBSD/usr/local/etc/apache24/httpd.conf, the other versions may have different locations and names. 2) Default home directory:/usr/local/www/apache24/after the data system was installed, I wrote a simple index.html file in this directory, only one sentence: # Nano Index.htmlthis isa FreeBSD server then checks whether the output is correct on the client. 3log file location log file is very large, Apache has two log files, and one is the IP records of all the Apache servers logged in,/var/log/httpd-access.log, the file records the login IP, time, browser type and so on, the other is an online error logging file,/var/log/httpd-Error.log, this file is useful for debugging Apache parameters. All two files are text files, which can be browsed and edited by a text editor such as Nano, and the location and filename of the recording file are changed by the corresponding configuration in httpd.conf. 4start, stop, and restart the run of the HTTPD server: This command is useful #apachectl start (stop restart graceful), especially after modifying the configuration file. 5) power on automatically start Apache24 service: need to edit/etc/rc.conf file in which the following statement is added: apache24_enable="YES"6the default character set of the webpage with automatic support for Chinese is parameter Adddefaultcharset ISO-8859-1this time in the browser to browse the Chinese Web page, will be garbled, you need to manually set the encoding for GBK or GB2312 to display Chinese to remove comments, modified to Adddefaultcharset GB2312 on it. 7Apache status information after installing Apache, we need to keep abreast of the various aspects of the server's system. Apache2 built-in server-status and Server-info two ways to view server information. Server-status refers to the server status information, we can understand the current situation of Apache operation, including the use of system resources, the current number of online. server-info mainly shows the Apache version, the loaded module information, and so on. In order to use these two functions, we must first modify the httpd.conf. First, remove the extendedstatus on the front of the comment. And then we find each<Location> and <Location> These two paragraphs, the two paragraphs in front of the comments are removed, and set the access rights. If it is not safe, you can set allow fromAll . Then you can use HTTP in the browser://Hostname/server-info visited the. problems with the personal User directory: Modify the main profile, comment out the #userdir public_html, and then in the user test's home directory/home/test to create a index.html file, you can browse: http://it's yourip/~test. 9Other configuration parameters that I think are more important: ServerRoot: Indicates that the server has a root directory that stores its configuration, errors, and log files. Listen: Allows you to bind the Apache service to the specified IP address and port to replace the default value documentroot: The root directory of your document. By default, all requests are answered from this directory. Hostnamelookups: Specify the name of the client or IP address to be noted, the past open source WWW server is almost Apache eminence, in recent years, there are nginx gradually popular, but also worth considering the deployment of good things. Two PHP installations: There are multiple PHP versions in the current FB10.1 ports, namely Php55, php56, and PHP5 (PHP is used by default-5. 4 version), so select Install PHP5. Install: # CD/usr/ports/lang/php5# Make installation clean Note that this only installs the PHP5, but now the APACHE24 can not parse and support PHP, also need: # CD/usr/ports/www/after the installation of mod_php5# make installs clean, you will also need to include the following statement in the Apache configuration file (see file location): DirectoryIndex index.php index.html<filesmatch"\.php$">SetHandler Application/x-httpd-PHP</filesmatch><filesmatch"\.phps$">SetHandler Application/x-httpd-php-Source</FilesMatch>Note Remember to restart Apache each time you modify the Apache configuration file to take effect: # Apachectl Restart is now in/usr/local/www/apache24/data to write the test file wen1.php file as follows:<? Phpphpinfo ()?>then to the client to open the file, if the PHP5 related information page appears, the installation is successful. Three MySQL installations: MySQL in FB7 has three versions, 5 for each.1 5.5 and 5.6, below I install the usual 5.5 version: # CD/usr/ports/databases/mysql55-server# make install-clean to set up the boot automatically, you need to edit/etc/rc.conf file in which to add: mysql_enable="YES"because the password for the administrator account of MySQL is empty by default, it is not safe to modify the Administrator account password This step is best not to omit: #/usr/local/bin/mysqladmin-u root-p Password'123456'one way to measure whether your MySQL server is starting properly is to run the MySQL client command under the command line (ports install MySQL-server words, will even mysql-client also installed): # MySQL Displays the MySQL client console (below) if there are no errors, indicating that the MySQL server is functioning correctly: # Mysqlwelcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 3Server Version:5.1. --RC FreeBSD port:mysql-server-5.1. 24_1type'Help ;'Or'\h'  forHelp. Type'\c'To clear the Buffer.mysql>Four installing PHP5-MySQL now PHP and MySQL are installed, but now the PHP5 can not operate MySQL database, or now PHP also lacks MySQL driver, on the other hand, now PHP has quite a lot of important is also commonly used extensions are not installed, These two problems can be solved together, is to install ports inside the PHP5-extensions:# CD/usr/ports/lang/php5-extensions# make install clean# apachectl graceful current PHP5-extensions in the choice of a total of 65, I do not list, generally at least such as the MySQL GD zlib iconv and so must be selected. Once the installation is complete, run the test file described above again and find that there is a lot of content now. Five other optional software: Phpmyadminphpmyadmin is a web interface for working with MySQL database, suitable for lazy people who are unfamiliar with SQL syntax: # CD/usr/ports/databases/phpmyadmin# make install clean
View Code

FREEBSDB Famp Lamp Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.