I. Apache installation as a powerful Web program is naturally the first choice for building a Web server. Now, we will install Apache. Run the following command on the terminal: sudo apt-get install apache2. After the installation is complete, start Apache sudo/etc/init. d/apache2 restart: Enter http: // localhost or http: // 127.0.0.1 in the browser. If "It works!" is displayed! ", It means that Apache is successfully installed. By default, Apache will create a directory named www under/var, which is the Web directory, all Web files that can be accessed through a browser must be placed in this directory. 2. Installing PHP software in Ubuntu is very simple. You only need one command to install the software. Execute the following command on the terminal: after sudo apt-get install libapache2-mod-php5 php5 is installed, We need to restart Apache and let it load the PHP module: sudo/etc/init. d/apache2 restart next, we will create a PHP file under the Web directory to test whether PHP can run normally. Command: sudo gedit/var/www/phpinfo. php www.2cto.com compiles a php file, for example, 3. (1) install mysql server. Here, we only need to install mysql server and then OK sudo apt-get install mysql-server at the end of the installation, it will ask you to enter the root password. Note that the root password here is not the Ubuntu root password. It is the root password you want to set for MySQL. Of course, if you like, you can set it to the same way. Because it is mainly used for local testing, MySQL is installed here. If it is used as a server, you may need to refer to other settings. (2) install clientapt-get install mysql-client (3) install mysql C language development interface apt-get install libmysqlclient15-dev ). mysql installation layout in ubuntu:/usr/bin client program and mysql_install_db/db database and log file/var/run mysqld server/etc/mysql configuration file my. cnf/usr/share/mysql Character Set, baseline program and error message/etc/init. d/mysql start the mysql server
2) set the mysql server to automatically start and close with the on/off server: Go to system> System Management> service to go to the "service settings" window, and activate mysql database service.
3 ). modify the storage directory of mysql database files: assume that the database file directory we specified is/db1. create a directory/db, and change its owner and group to mysql: mysql. command: chown mysql: mysql db2. disable mysql Database Service: mysqladmin-u root-p shutdown www.2cto.com 3. modify the mysql configuration file my. cnf: Change datadir =/var/lib/mysql to datadir =/db4. re-initialize the data file: Execute mysql_install_db5. start mysql Database Service: sudo/etc/init. d/mysql start6. set the mysql Database root password: mysqladmin-u root password 'new-password'. Now we will find mysql-related files in the/db directory. If we create a new database, its database files will also appear in the db directory. Indicates that the file storage directory of the mysql database we modified is correct.
4) configure the INNODB Storage engine of the mysql database:
1. view the mysql storage engine: log on to the mysql database and run the show engines command at the mysql> prompt. Conclusion: InnoDB | YES indicates that the mysql database server supports the InnoDB engine. 2. Set InnoDB as the default engine: Add default-storage-engine = INNODB under [mysqld] in the configuration file my. cnf and save the statement. 3. Restart the mysql server: mysqladmin-u root-p shutdown (Press ENTER), sudo/etc/init. d/mysql start (Press ENTER ). 4. log on to the mysql database and run the show engines command at the mysql> prompt. If InnoDB | DEFAULT is displayed, InnoDB is successfully set as the DEFAULT engine. Ps: Here I use the restart command sudo/etc/init. d/mysql restart, and an error message is displayed, so I used the stupid method of closing and starting the service (step 3) above. It is said that the following command can be done at a time: sudo apt-get install apache2 mysql-server php5 php5-mysql phpmyadmin this step please remember the MySql password.
In addition, you can install MySQL to the graphical Management Interface: sudo apt-get install mysql-admin * If the installation is successful after mysql_connect () connection error, execute the following command sudo apt-get install php5-mysql
4. Download The Discuz installation package $ cd ~ $ Mkdir discuz $ cd discuz $ wget unzip apt-get install unzip $ unzip Discuz_7.0.0_FULL_ SC _GBK.zip5. Create a bbs directory under/var/www, copy all files under the previously decompressed upload directory to the bbs directory $ cd/var/www/www.2cto.com $ sudo mkdir bbs $ cd ~ $ Cd discuz/$ sudo cp-a upload/*/var/www/bbs/6, give the www folder 777 attribute in var $ sudo chmod-R 777/var/www7, open your browser and enter: http: // server IP Address/bbs/install/index. php Note: If the page cannot be opened, restart apache. $ Sudo/etc/init. d/apache2 restart author kevin_ysu