search
HomeBackend DevelopmentPHP TutorialPHP+MYSQL+APACHE configuration process under Linux excerpt from page 1/2

需要软件如下: 
apache: http://www.apache.org 
mysql: http://www.mysql.com 
php: http://www.php.net/downloads.php 
gd: http://www.boutell.com/gd/#buildgd 
ZendOptimizer http://www.zend.org/products/zend_optimizer 
Gettext http://ftp.gnu.org/pub/gnu/gettext/ 
netpbm http://sourceforge.net/projects/netpbm/ 
所用的软件版本如下: 
Redhat Enterprise As 4 
(apache)httpd-2.0.50.tar.gz 
mysql-standard-5.0.18-linux-i686.tar.gz 
php-5.1.2.tar.gz 
gd-2.0.33.tar.gz 
ZendOptimizer-2.6.2-linux-glibc21-i386.tar.gz 
Imap 
Gettext 
一.安装MYSQL mysql-standard-5.0.18-linux-i686.tar.gz 
我把他全部下载到/usr/local/software目录下 
进入安装包目录:cd /usr/local/software 
1、[root@localhost software]# chmod 755 mysql-standard-5.0.18-linux-i686.tar.gz 
2、[root@localhost software]# tar xfz mysql-standard-5.0.18-linux-i686.tar.gz 
解压后生成mysql-standard-5.0.18-linux-i686目录,我们进入该目录: 
3、[root@localhost software]# cd mysql-standard-5.0.18-linux-i686 
进入后就开始配置mysql了,配置过程中我们要给mysql设置一个 
安装目录,我们设置在 /usr/local/mysql 下,以为把文件放到一个地方比较容易管理,如果你还想获得更多的配置信息,使用 ./configure --help: 
在这里我要特别强调在编译的时候要选择好MYSQL的默认编码,因为如果不选择按默认安装的时候在JSP中就不支持GBK编码了 
所以我这样编译 
访问mysql要一个专门的用户,而且必须给相应的访问权限,这里我们就设置root和mysql有权限访问. 
7、我们先建立一个mysql和mysql用户来访问mysql: 
[root@localhost mysql-standard-5.0.18-linux-i686]# groupadd mysql #建立mysql组 
8、[root@localhost mysql-standard-5.0.18-linux-i686]# useradd mysql -g mysql #建立mysql用户并且加入到mysql组中 
9、建立用户后我们就初始化表 (注意:必须先执行本步骤后才能进行以下步骤) 
[root@localhost mysql-standard-5.0.18-linux-i686]# ./scripts/mysql_install_db --user=mysql 
#初试化表并且规定用mysql用户来访问初始化表以后就开始给mysql和root用户设定访问权限,; 
10、[root@localhost mysql-standard-5.0.18-linux-i686]# mv mysql-standard-5.0.18-linux-i686 /usr/local/mysql 
然后设置权限 
cd /usr/local/mysql 
11、[root@localhost mysql]# chown -R root . #设定root能访问/usr/local/mysql 
12、[root@localhost mysql]# chown -R mysql data #设定mysql用户能访问/usr/local/mysql/data ,里面存的是mysql的数据库文件 
13、[root@localhost mysql]# chgrp -R mysql . #设定mysql组能够访问/usr/local/mysql 
14、设置完成后,基本上就装好了,好了,我们运行一下我们的mysql: 
[root@localhost mysql]# /usr/local/mysql/bin/mysqld_safe --user=mysql & 
如果没有问题的话,应该会出现类似这样的提示: 
[1] 42264 
# Starting mysqld daemon with databases from /usr/local/mysql/var 
这就证明你安装成功了 
用如下命令修改root密码,默认安装密码为空,为了安全你必须马上修改 
15、/usr/local/mysql/bin/mysqladmin -uroot password xksoft321 
现在修改的密码为:xksoft321 
16.设置开机自动启动 
cp support-files/mysql.server /etc/init.d/ 
二、安装apache 
进入安装包目录:cd /usr/local/software 
1、# chmod 755 httpd-2.0.50.tar.gz 
2、# tar xfz httpd-2.0.50.tar.gz 
3、# cd httpd-2.0.50 
开始配置APACHE 
4、#./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-mods-shared=most 
# ./configure --prefix=/usr/local/apache2 --enable-so --enable-module=most --enable-shared=max --enable-rewrite 
# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-access 
#./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all –-enable-rewrite=shared 
5、# make 
6、# make install 
7. Check the modules compiled into apache:
# /usr/local/apache2/bin/httpd -l
compiled-in modules:
http_core.c
mod_so.c
Seeing the above information indicates that apache supports dso mode. In this way, the php and resin modules can be added using dso.
3. Install GD
Enter the installation package directory: cd /usr/local/software
1. tar -zxvf gd-2.0.33.tar.gz
2. cd gd-2.0.33
3. ./configure -- prefix=/usr/local/gd2
4.make
5.make install
Gettext
1 .tar xfz
2 cd
3 ./configure –with-prefix=/usr/local/gettext
4 make
5 make install
4. Install php
Enter the installation package directory: cd /usr/local/software
1. #tar 3. Configure. This step is crucial. It must be set up properly, especially what you want to support, such as GD library, xml, mysql, etc. If you want to know the detailed configuration, execute ./configure --help. Get:
# ./configure --enable-mbstring=LANG --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd2 --with-apxs2=/usr/local/apache2 /bin/apxs –with-gettext=/usr/local/gettext
――enable-mbstring=LANG (solve the problem of php extension:mbstring)
If there are no errors in the above configuration, then it should finally display thank you for using PHP, etc. words, then it proves that the configuration is successful. If the above configuration options are not supported, an error will be prompted.
For example, if you do not have mysql installed, then --with-mysql cannot be used, so be sure to pay attention to whether the corresponding option can be supported by the system. If it appears Error, then install the corresponding program first, or remove the relevant options, and then compile after configuration:
4. # make
After the compilation is successful, the words "Build complete." will appear, then you can install it:
5. # make install
6. After the installation is complete, copy php.ini-dist to /usr/local/lib/ and rename it to php.ini
# cp php.ini-dist /usr/local/lib/php.ini
Basically arrived PHP is successfully installed here. If there is an error in the middle, there will generally be no error except when the correct option is not selected during configuration.
7. In order to allow Apache to directly parse PHP, we need to perform some configurations.
# vi / usr/local/apache2/conf/httpd.conf
In the httpd.conf file, add (the following two sentences should be added after other AddTypes)
AddType application/x-httpd-php .php .phtml
AddType application/x -httpd-php-source .phps
Make sure there is the following sentence in the file. If not, add it after all LoadModules:
LoadModule php5_module modules/libphp5.so
Add index.php after the following DirectoryIndex
DirectoryIndex index.php index. html index.html.var
Okay, use ":wq" in vi to save the httpd.conf file and exit vi.
8. Start apache server:
# /usr/local/apache2/bin/apachectl restart
Now apache can run php. Write a file to test it. Create a new phpinfo in the /usr/local/apache2/htdocs directory. .php file,
There is only one line of code in the file:

Save this file, enter http://localhost/phpinfo.php in your browser, you should see PHP system message.
If an error occurs, such as prompting you to download phpinfo.php, then apache cannot parse the php file yet, so please carefully check whether the above operations are correct.
5. ZendOptimizer
Enter the installation package directory: cd /usr/local/software
1. #tar When entering the location of your php.ini file, enter /usr/local/lib/
Select YES when asked Are you using Apache web server?
6.
1../configure --prefix=/usr
2. make
3. make check
4. make install
Start the service configuration with the system
If you want to run the httpd service when the computer starts, you can add these lines to the /etc/rc.d/rc.local file:
#start apache
/usr/local/apache2/bin/apachectl start
If it cannot be started, please give the corresponding startup script executable permissions
For example, apache cannot be started chmod a=x apachectl
For future operations, do not enter something like /usr/local /apache2/bin path, add the $PATH variable in the /etc/profile file
Add the paths of apache, tomcat and mysql
Attachment:
1. Create virtual hosts for resin and apache
For example, the one created is tes1. jsp.com test2.jsp.com Two virtual hosts
vi /usr/java/httpd2/conf/httpd.conf
Copy the following content to httpd.conf
NameVirtualHost 192.168.0.* The IP where the virtual host is established
< ;VirtualHost 192.168.1.*> /home/jsp2 /
ServerName test2.jsp.com

vi /usr/java/resin/conf/resin.conf
Find the following code and modify it:








host>
Save and start apache and resin
tes1.jsp.com and tes2.jsp.com virtual hosts can run
You can do the following test http://localhost/caucho-status/
You can see that there are
on the test surface Virtual Host: tes1.jsp.com:80
Virtual Host: tes2.jsp.com:80
Prove that the JSP virtual host is working normally
2. Linux software installation
Linux software packages found from the website or CD, common Format includes rpm, deb, tar, gz, tgz, zip, bz2 and so on. The ones we usually use the most are probably rpm and tgz. According to statistics, the most popular versions on the Internet should be redhat and mandrake, and these two versions are packaged in rpm. Tar is the most versatile software package. Format, almost every Linux software will provide software packages in tar format, because this format of software packages is supported by any version of Linux, so everyone must at least understand how to use tar and rpm. As for deb, you can use the alien tool to convert it to tgz or rpm. bz2 can be unpacked with bunzip2.
1. Installation of RPM files
RPM is the abbreviation of RedHat Package Manager (RedHat package management tool). Although this file format name is marked with the RedHat logo, its original design concept is open and now includes OpenLinux, mandrake and Turbo Linux and other Linux distributions have adopted it, and it can be regarded as a recognized industry standard.
RPM files are the easiest to install on Linux systems. Take the famous image processing software XV as an example:
In Terminal, the basic installation instructions are as follows:
rpm -i To install application software on the computer, you only need to add the appropriate URL path before the file name of the software:
rpm -i ftp://ftp.trilon.com/pub/xv/xv-3.10a-13.i386.rpm
As a Software package management tool, RPM manages the information of all RPM program components installed on the system. We can also use RPM to uninstall related applications.
rpm -e Description information of the software package;
-qf: Find which RPM software package the specified file belongs to;
-Va: Verify all RPM software packages and find missing files;
For more detailed parameters and their usage, please see the RPM help document.
In X-Window, the graphical installation and management of RPM files is more user-friendly. After installing kpackage on kde, installing rpm is just a click of the mouse, which is more convenient than windows 98. But kde must be installed first.
Let me introduce the more commonly used method. Still taking XV software as an example, find the xv-3.10a-13.i386.rpm file in the Linux file manager and right-click it with the mouse. , you can find three instructions specially prepared for RPM software packages in the pop-up menu: Show Info, Upgrade, and Install.
After selecting “Show Info”, we will see the package information window as shown in the picture. The window is divided into three parts. The top shows the software name, size, creation and installation date, developer website and other related information; in the middle box, there is an overview of the software; and the bottom shows the information in the software package. It contains all the files and their path information. It will tell you which directories of the system each file in the package will be installed into.
The advantage of paying attention to this information is that you can easily find the path to start the program.
After clicking the "Install" or "Upgrade" button at the bottom, the software installation or upgrade will begin, and a window will pop up to prompt the installation progress.
RPM software packages have many advantages over other types of software packages, but this does not mean that the installation of RPM software is always smooth. Common mistakes include trying to install an already installed software, the software to be installed requires the support of other software or system library files (in this case, these related software or system library files should be installed first), etc. The situation is similar to that of Windows similar.
2. Installation of tar
tar.gz, tar.Z, tgz, bz2 and other file formats must be decompressed into tar first and then unpacked and installed with tar. Examples of decompression and unpacking instructions are briefly described below:
1. Solution xv.tar.gz: tar zxf xv.tar.gz
2. Solution to xv.tar.Z: tar zxf xv.tar.Z
3. Solution xv.tgz: tar zxf xv.tgz
4. Solution to xv.bz2: bunzip2 xv.bz2
5. Solution to xv.tar: tar xf xv.tar
A bunch of files obtained after unpacking are usually stored in a directory. Depending on the software author, some will be already compiled programs, and more will be source code that needs to be compiled by yourself. After entering the corresponding directory, use the "ls -F -color" command. The executable program will be displayed in bright green with an "*" mark. For compiled programs, just type the command line with the path to run the program.
It is recommended to read the description file first after unzipping. You should first use a document editor such as vi to read the Readme, Install and other important related documents in the software directory. Here you will find the detailed compilation steps and precautions of the software, and you can understand the installation instructions. What requirements do you need to change the compilation configuration if necessary?
The source code of some software packages can be uninstalled using the make install command after compilation and installation. If this function is not provided, the uninstallation of the software must be manually deleted. Since the software may install files scattered in multiple directories of the system, it is often difficult to delete them cleanly. Then you should configure it before compiling and specify the target path where the software will be installed: ./configure --prefix=directory name , so that you can use the "rm -rf software directory name" command to perform a clean and complete uninstall. Compared with other installation methods, it is the most difficult for users to compile and install by themselves. It is suitable for people who have some experience in using Linux and is generally not recommended for beginners.
The usual compilation steps will be as follows:
./configure
make
make install (you need to obtain root identity to execute this command)
Uninstallation is available: make uninstall or manual deletion
After compilation is completed, in the current directory or named src The executable program of the software can be easily found in the subdirectory of . At this point, the software installation comes to an end.

Current page 1/2 12Next page

The above introduces the PHP+MYSQL+APACHE configuration process under Linux. Excerpted from page 1/2, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
解决方法:您的组织要求您更改 PIN 码解决方法:您的组织要求您更改 PIN 码Oct 04, 2023 pm 05:45 PM

“你的组织要求你更改PIN消息”将显示在登录屏幕上。当在使用基于组织的帐户设置的电脑上达到PIN过期限制时,就会发生这种情况,在该电脑上,他们可以控制个人设备。但是,如果您使用个人帐户设置了Windows,则理想情况下不应显示错误消息。虽然情况并非总是如此。大多数遇到错误的用户使用个人帐户报告。为什么我的组织要求我在Windows11上更改我的PIN?可能是您的帐户与组织相关联,您的主要方法应该是验证这一点。联系域管理员会有所帮助!此外,配置错误的本地策略设置或不正确的注册表项也可能导致错误。即

Windows 11 上调整窗口边框设置的方法:更改颜色和大小Windows 11 上调整窗口边框设置的方法:更改颜色和大小Sep 22, 2023 am 11:37 AM

Windows11将清新优雅的设计带到了最前沿;现代界面允许您个性化和更改最精细的细节,例如窗口边框。在本指南中,我们将讨论分步说明,以帮助您在Windows操作系统中创建反映您的风格的环境。如何更改窗口边框设置?按+打开“设置”应用。WindowsI转到个性化,然后单击颜色设置。颜色更改窗口边框设置窗口11“宽度=”643“高度=”500“&gt;找到在标题栏和窗口边框上显示强调色选项,然后切换它旁边的开关。若要在“开始”菜单和任务栏上显示主题色,请打开“在开始”菜单和任务栏上显示主题

如何在 Windows 11 上更改标题栏颜色?如何在 Windows 11 上更改标题栏颜色?Sep 14, 2023 pm 03:33 PM

默认情况下,Windows11上的标题栏颜色取决于您选择的深色/浅色主题。但是,您可以将其更改为所需的任何颜色。在本指南中,我们将讨论三种方法的分步说明,以更改它并个性化您的桌面体验,使其具有视觉吸引力。是否可以更改活动和非活动窗口的标题栏颜色?是的,您可以使用“设置”应用更改活动窗口的标题栏颜色,也可以使用注册表编辑器更改非活动窗口的标题栏颜色。若要了解这些步骤,请转到下一部分。如何在Windows11中更改标题栏的颜色?1.使用“设置”应用按+打开设置窗口。WindowsI前往“个性化”,然

OOBELANGUAGE错误Windows 11 / 10修复中出现问题的问题OOBELANGUAGE错误Windows 11 / 10修复中出现问题的问题Jul 16, 2023 pm 03:29 PM

您是否在Windows安装程序页面上看到“出现问题”以及“OOBELANGUAGE”语句?Windows的安装有时会因此类错误而停止。OOBE表示开箱即用的体验。正如错误提示所表示的那样,这是与OOBE语言选择相关的问题。没有什么可担心的,你可以通过OOBE屏幕本身的漂亮注册表编辑来解决这个问题。快速修复–1.单击OOBE应用底部的“重试”按钮。这将继续进行该过程,而不会再打嗝。2.使用电源按钮强制关闭系统。系统重新启动后,OOBE应继续。3.断开系统与互联网的连接。在脱机模式下完成OOBE的所

Windows 11 上启用或禁用任务栏缩略图预览的方法Windows 11 上启用或禁用任务栏缩略图预览的方法Sep 15, 2023 pm 03:57 PM

任务栏缩略图可能很有趣,但它们也可能分散注意力或烦人。考虑到您将鼠标悬停在该区域的频率,您可能无意中关闭了重要窗口几次。另一个缺点是它使用更多的系统资源,因此,如果您一直在寻找一种提高资源效率的方法,我们将向您展示如何禁用它。不过,如果您的硬件规格可以处理它并且您喜欢预览版,则可以启用它。如何在Windows11中启用任务栏缩略图预览?1.使用“设置”应用点击键并单击设置。Windows单击系统,然后选择关于。点击高级系统设置。导航到“高级”选项卡,然后选择“性能”下的“设置”。在“视觉效果”选

Windows 11 上的显示缩放比例调整指南Windows 11 上的显示缩放比例调整指南Sep 19, 2023 pm 06:45 PM

在Windows11上的显示缩放方面,我们都有不同的偏好。有些人喜欢大图标,有些人喜欢小图标。但是,我们都同意拥有正确的缩放比例很重要。字体缩放不良或图像过度缩放可能是工作时真正的生产力杀手,因此您需要知道如何对其进行自定义以充分利用系统功能。自定义缩放的优点:对于难以阅读屏幕上的文本的人来说,这是一个有用的功能。它可以帮助您一次在屏幕上查看更多内容。您可以创建仅适用于某些监视器和应用程序的自定义扩展配置文件。可以帮助提高低端硬件的性能。它使您可以更好地控制屏幕上的内容。如何在Windows11

10种在 Windows 11 上调整亮度的方法10种在 Windows 11 上调整亮度的方法Dec 18, 2023 pm 02:21 PM

屏幕亮度是使用现代计算设备不可或缺的一部分,尤其是当您长时间注视屏幕时。它可以帮助您减轻眼睛疲劳,提高易读性,并轻松有效地查看内容。但是,根据您的设置,有时很难管理亮度,尤其是在具有新UI更改的Windows11上。如果您在调整亮度时遇到问题,以下是在Windows11上管理亮度的所有方法。如何在Windows11上更改亮度[10种方式解释]单显示器用户可以使用以下方法在Windows11上调整亮度。这包括使用单个显示器的台式机系统以及笔记本电脑。让我们开始吧。方法1:使用操作中心操作中心是访问

如何在Safari中关闭iPhone的隐私浏览身份验证?如何在Safari中关闭iPhone的隐私浏览身份验证?Nov 29, 2023 pm 11:21 PM

在iOS17中,Apple为其移动操作系统引入了几项新的隐私和安全功能,其中之一是能够要求对Safari中的隐私浏览选项卡进行二次身份验证。以下是它的工作原理以及如何将其关闭。在运行iOS17或iPadOS17的iPhone或iPad上,如果您在Safari浏览器中打开了任何“无痕浏览”标签页,然后退出会话或App,Apple的浏览器现在需要面容ID/触控ID认证或密码才能再次访问它们。换句话说,如果有人在解锁您的iPhone或iPad时拿到了它,他们仍然无法在不知道您的密码的情况下查看您的隐私

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment