LAMP
一、Linux
操作系统:CentOS6.4
1.配置好可用的yum源
2.开发环境支持:
# yum groupinstall -y "Development tools"
# yum groupinstall -y "Server Platform Development"
Ubuntu13.04 安装 LAMP/Vsftpd/Webmin/phpMyAdmin 服务及设置http://www.linuxidc.com/Linux/2013-06/86250.htm
CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12)http://www.linuxidc.com/Linux/2013-03/80333p3.htm
RedHat5.4下Web服务器架构之源码构建LAMP环境及应用PHPWindhttp://www.linuxidc.com/Linux/2012-10/72484p2.htm
LAMP源码环境搭建WEB服务器Linux+Apache+MySQL+PHPhttp://www.linuxidc.com/Linux/2013-05/84882.htm
二、Apache
编译安装httpd-2.4.9
1.安装pcre-devel(依赖包)
#yum install pcre-devel -y
(关于pcre:http://www.linuxidc.com/Linux/2014-04/99536.htm)
#tar -xf apr-1.5.0.tar.bz2 -C /usr/src/
#cd /usr/src/apr-1.5.0
#./configure --prefix=/usr/local/apr //指定其安装位置
# make && make install
(关于apr:http://zh.wikipedia.org/wiki/Apache%E5%8F%AF%E7%A7%BB%E6%A4%8D%E8%BF%90%E8%A1%8C%E6%97%B6)
#tar -xf apr-util-1.5.3.tar.bz2 -C /usr/src/
# cd /usr/src/apr-util-1.5.3
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make && make install
#tar -xf httpd-2.4.9.tar.bz2 -C /usr/src
# cd /usr/src/httpd-2.4.9
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so --enable-ssl --enable-cgi --enable-rewrite --with-zlib --with-pcre --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-modules=most --enable-mpms-shared=most --with-mpm=event
================================================================
释义:
--prefix=/usr/local/apache #→指定其安装位置
--sysconfdir=/etc/httpd #→指定配置文件安装位置
--enable-so #→启用基于DSO的方式动态加载模块
--enable-ssl #→启用基于https协议的功能
--enable-cgi #→启用基于cgi协议的功能
--enable-rewrite #→启用支持URL重写的功能
--with-zlib #→指定支持在互联网上发送数据报文时,通用的压缩库的API
--with-pcre #→指定支持poll的cgi
--with-apr=/usr/local/apr #→指定par的安装路径
--with-apr-util=/usr/local/apr-util/ #→指定par-util的安装路径
--enable-modules=most #→启用大多数常用的模块
--enable-mpms-shared=all #→启用加载所有的mpm模块
--with-mpm=event #→指定接下来httpd的工作模式是event
======================================================================
# make && make install
a).静态:使用--with-mpm=指定模块名称;一旦编译安装完成,无法卸载,只能从新编译安装。
b).动态:使用--enable-mpms-shared选项即可启用此特性。当给出的参数为all时,所有此平台支持的MPM模块都会被安装。可运行时加载,构建 MPM 为动态模块允许通过修改LoadModule指令内容来改变MPM,而不用重新编译安装。
配置:
a).设置pid文件的路径:
#vim /etc/httpd/httpd.conf //添加
PidFile "/var/run/httpd.pid"
#vim /etc/rc.d/init.d/httpd //修改
apachectl=/usr/local/apache/bin/apachectl
httpd=${HTTPD-/usr/local/apache/bin/httpd}
# chmod +x /etc/rc.d/init.d/httpd
# chkconfig --add httpd
# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
# chkconfig httpd on
# chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# service httpd start
# ps -elFH
三、MySQL
1.安装
# tar xf mysql-5.5.33-linux2.6-x86_64.tar.gz -C /usr/local
# ln -sv /usr/local/mysql-5.5.33-linux2.6-x86_64 mysql 创建软连接,易于操作
# fdisk /dev/sda //10G
#pvcreate /dev/sda3 //创建物理卷
#vgcreate myvg /dev/sda8 //创建卷组
#lvcreate -L 8G -n mydata myvg //创建逻辑卷
#mke2fs -t ext4 /dev/myvg/mydata //格式化逻辑卷
# mkdir /mydata //创建逻辑卷挂载目录
#mkdri -pv /mydata/data //创建mysql数据存放目录
# vim /etc/fstab //添加开机自动挂载
/dev/myvg/mydata /mydata ext4 defaults 0 0
# mount -a //挂载
3.新建用户以安全方式运行进程
#groupadd -r mysql //创建系统组mysql
#useradd -r -s /sbin/nologin -g mysql mysql -M -D /mydata/data mysql
//创建系统用户mysql
#chown -R mysql:mysql /mydata/data
//设置目录属主属组
4.初始化mysql
# cd /usr/local/mysql
# scripts/mysql_install_db --datadir=/mydata/data --user=mysql
//初始化数据库
# chown -R root .
//设置当前目录所有文件属主为root
5.提供脚本
#cd /usr/local/mysql
#cp support-files/mysql.server /etc/rc.d/init.d/mysqld
//设置脚本mysqld
#chmod +x /etc/rc.d/init.d/mysqld
//给脚本执行权限
# chkconfig --add mysqld
//添加开机启动
# chkconfig mysqld on
6.提供配文件
#cd /usr/local/mysql
#cp support-files/my-large.cnf /etc/my.cnf
#vim /etc/my.cnf
thread_concurrency = 2
//修改,并发线程数,bithread_concurrency的值为CPU个数乘以2
datadir = /mydata/data
#添加,mysql数据文件的存放路径:
7.其他配置
# vim /etc/profile.d/mysqld.sh
export PATH=/usr/local/mysql/bin:$PATH
# source /etc/profile.d/mysqld.sh
#vim /etc/man.config
MANPATH /usr/local/mysql/man //添加此行
# ln -sv /usr/local/mysql/include /usr/include/mysql
//输出mysql的头文件至系统头文件路径/usr/include
# echo '/usr/local/mysql/lib' > /etc/ld.so.conf.d/mysql.conf
//输出mysql的库文件给系统库
#ldconfig //重载系统库:
# service mysqld start
# ss -rnl | grep 3306
#mysql
mysql> use mysql
mysql> select host,user,password from user;
mysql> DELETE FROM user WHERE user = ''; //删除空用户
mysql> DELETE FROM user WHERE user = '::1'; //删除ipv6用户
mysql> UPDATE user SET password = PASSWORD('Hoolee') WHERE password = '';
//为root用户设置密码
mysql> FLUSH PRIVILEGES;
更多详情见请继续阅读下一页的精彩内容:http://www.linuxidc.com/Linux/2014-05/10187p2.htm

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.