sudo aptitude install apache2 php5 php5-gd mysql-server php5-mysql
Specifying the Document Root for the Apache2 HTTP Server
Creating the Document Root Location
1. Choose Places > Home Folder.
2. From the context menu, choose Create Folder.
3. Enter the name of the folder, for example, public_html.
Creating a New Virtual Host
1. To launch the Terminal, choose Applications>Accessories>Terminal. The Terminal window opens.
2. To copy the configuration file of the default virtual host to a new file (mysite), type the following command at the command prompt:
sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
3. Run the gedit application and edit the new configuration file (mysite) in it:
gksudo gedit /etc/apache2/sites-available/mysite
If asked, enter the password that you specified for the root user during the installation of your operating system.
4. Change the Document Root to point to the new location:
/home/
5. Change the Directory directive, replace
< Directory /var/www/ >
with
< Directory /home/user/public_html/ >
6. Save the file mysite
Activating the New Virtual Host
1. To deactivate the default host and activate the new host, launch the Terminal and run the following two utilities in the Terminal window:
sudo a2dissite default && sudo a2ensite mysite
2. Restart the Apache HTTP server:
sudo /etc/init.d/apache2 restart
Configuring the MySQL Database Server
During the installation of the MySQL database server, a root user is created. By default, no password is specified for the root MySQL server user. You need to connect to the MySQL server and specify a password for the root user. You will need the password for creating other MySQL server users.
1. To connect to the MySQL server, launch the Terminal and in the Terminal window enter the following command:
mysql -u root
The MySQL command prompt appears.
2. At the command prompt enter the following command and press Enter:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('
If the command is executed successfully, the following message is displayed:
Query OK, 0 rows affected (0.00 sec)
Installing and Enabling the XDebug Debugger
Installing XDebug
sudo aptitude install php5-dev php-pear && sudo pecl install xdebug
or: sudo apt-get install php5-xdebug
Enabling XDebug
To enable XDebug, you need to edit the php.ini file in the gedit text processor.
1. To start the gedit text processor, launch the Terminal and type the following command at the command prompt:
sudo /etc/php5/apache2/php.ini .
2. Add the following lines to the file:
zend_extension=/usr/lib/php5/20051025/xdebug.so
xdebug.remote_enable=on
Check here for more details on configuring XDebug.
Using an AMP Package
To download and install the PHP engine, the Apache HTTP Server, and the MySQL database server as one stack, use the XAMPP for Linux package.
Post from gnome-blog.
Không có nhận xét nào:
Đăng nhận xét