https://wiki.archlinux.org/api.php?action=feedcontributions&user=Salamynder&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:44:47ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=XAMPP&diff=260217XAMPP2013-06-01T15:53:35Z<p>Salamynder: added simple security advice for local test server (taken from stackexchange, I am not the author)</p>
<hr />
<div>[[Category:Web Server]]<br />
[[cs:Xampp]]<br />
[[es:Xampp]]<br />
[[it:Xampp]]<br />
[[ru:Xampp]]<br />
[http://www.apachefriends.org/en/xampp.html XAMPP] is an easy to install Apache distribution containing MySQL, PHP and Perl. It contains: Apache, MySQL, PHP & PEAR, Perl, ProFTPD, phpMyAdmin, OpenSSL, GD, Freetype2, libjpeg, libpng, gdbm, zlib, expat, Sablotron, libxml, Ming, Webalizer, pdf class, ncurses, mod_perl, FreeTDS, gettext, mcrypt, mhash, eAccelerator, SQLite and IMAP C-Client.<br />
<br />
== Installation ==<br />
=== AUR ===<br />
* [https://aur.archlinux.org/packages.php?ID=14141 Xampp package] in the [[AUR]]<br />
<br />
=== Manual ===<br />
{{Note|If you are running 64-bit arch, you must install {{Pkg|lib32-glibc}} and {{Pkg|gcc-libs-multilib}} from the [[multilib]] repository.}}<br />
# Download the latest version from [http://www.apachefriends.org/en/xampp-linux.html#374 here].<br />
# In the terminal run the following from the folder where the archive was downloaded to: {{bc|# tar xvfz xampp-linux-*.tar.gz -C /opt}}<br />
<br />
== Configuration ==<br />
<br />
Setting the individual parts of XAMPP can by made by editing following files:<br />
<br />
'''/opt/lampp/etc/httpd.conf''' - Apache configuration. For example you can change folder with web page's source files.<br />
<br />
'''/opt/lampp/etc/php.ini''' - PHP configuration.<br />
<br />
'''/opt/lampp/phpmyadmin/config.inc.php''' - phpMyAdmin configuration.<br />
<br />
'''/opt/lampp/etc/proftpd.conf''' - proFTP configuration.<br />
<br />
'''/opt/lampp/etc/my.cnf''' - MySQL configuration.<br />
<br />
If you would like to set up security of server, you can do it simply by this command:<br />
# /opt/lampp/lampp security<br />
You will be asked step by step to choose passwords for web page's access, user "pma" for phpMyAdmin, user "root" for MySQL and user "nobody" for proFTP.<br />
<br />
== Usage ==<br />
<br />
Use the following commands to control XAMPP: {{bc|# /opt/lampp/lampp start,stop,restart}}<br />
<br />
If you get this error when you start it:<br />
{{bc|<br />
Starting XAMPP for Linux 1.7.7...<br />
/opt/lampp/lampp: line 21: netstat: command not found<br />
/opt/lampp/lampp: line 21: netstat: command not found<br />
XAMPP: Starting Apache with SSL (and PHP5)...<br />
/opt/lampp/lampp: line 241: /bin/hostname: No such file or directory<br />
/opt/lampp/lampp: line 21: netstat: command not found<br />
XAMPP: Starting MySQL...<br />
/opt/lampp/bin/mysql.server: line 263: hostname: command not found<br />
/opt/lampp/lampp: line 21: netstat: command not found<br />
XAMPP: Starting ProFTPD...<br />
XAMPP for Linux started.<br />
}}<br />
Install net-tools and inetutils from [core] and you are good to go:<br />
# pacman -S net-tools inetutils<br />
<br />
== Removal ==<br />
<br />
Be sure to stop all lampp services.<br />
<br />
{{bc|# /opt/lampp/lampp stop}}<br />
<br />
All the files needed by Xampp to be installed are located in the previous /opt/lampp folder. So, to uninstall Xampp, consider this command.<br />
<br />
{{bc|# rm -rf /opt/lampp}}<br />
<br />
'''NOTE:'''If you had create symlinks, you need to destroy them too!<br />
<br />
== Hosting files outside the htdocs directory ==<br />
The document root (web root) directory is located at '''/opt/lampp/htdocs/'''. All files placed in this directory will be processed by the web server.<br />
<br />
To host other files on your system with XAMPP, you can configure an alias with apache.<br />
<br />
#Edit apache's httpd.conf with your favorite editor. {{bc|nano /opt/lampp/etc/httpd.conf}}<br />
#Find "DocumentRoot", you will see something like:<br />
{{bc|<br />
DocumentRoot "/opt/lampp/htdocs"<br />
<Directory "/opt/lampp/htdocs"><br />
... <br />
...<br />
<br />
</Directory>}}<br />
<br />
In the next line after "</Directory>" paste this:<br />
{{bc|<br />
<Directory "/yourDirectory/"><br />
Options Indexes FollowSymLinks ExecCGI Includes<br />
AllowOverride All<br />
Require all granted<br />
</Directory>}}<br />
<br />
Next find the "<IfModule alias_module>": <br />
{{bc|<br />
<IfModule alias_module><br />
<br />
#<br />
# Redirect: Allows you to tell clients about documents that used to <br />
# exist in your server's namespace, but do not anymore. The client <br />
# will make a new request for the document at its new location.<br />
# Example:<br />
# Redirect permanent /foo http://www.example.com/bar<br />
...<br />
</IfModule><br />
}}<br />
And before the "</IfModule>" paste this:<br />
{{bc|<br />
Alias /yourAlias /yourDirectory/<br />
}}<br />
<br />
Now do not forget to restart apache: {{bc|# /opt/lampp/lampp restart}}<br />
<br />
This will allow you to host files from your home directory (or any other directory) with XAMPP.<br />
<br />
In the above example, you can access the files by pointing your web browser to '''localhost/yourAlias'''.<br />
<br />
== Debugging and Profiling with Xdebug and Xampp ==<br />
<br />
For detailed instructions go [http://xdebug.org/find-binary.php here].<br />
<br />
You must first download the Xampp Development Tools from the same download page [http://www.apachefriends.org/en/xampp-linux.html here].<br />
<br />
Extract this into your Xampp directory.<br />
<br />
{{bc|tar xvfz xampp-linux-devel-x.x.x.tar.gz -C /opt}}<br />
<br />
You should be able to successfully run {{bc|/opt/lampp/bin/phpize}} in your xdebug folder.<br />
<br />
== PhpMyAdmin 403 Access Forbidden ==<br />
<br />
If your http://localhost/phpmyadmin returns "403 Access Forbidden", you need to edit the following settings in /opt/lampp/etc/extra/httpd-xampp.conf:<br />
<br />
<Directory "/opt/lampp/phpmyadmin"><br />
AllowOverride AuthConfig Limit<br />
#Order allow,deny<br />
#Allow from all<br />
Require all granted<br />
</Directory><br />
<br />
== Local Test Server Security ==<br />
<br />
Apache and MySQL can be configured so that they only listen to requests from your own computer. For most test systems this is fine and it greatly reduces the risk because the services are not reachable from the Internet.<br />
<br />
Before you start XAMPP for the first time find and edit these files:<br />
<br />
For Apache edit the files xampp\apache\conf\httpd.conf and xampp\apache\conf\extra\httpd-ssl.conf. Look for lines starting with "Listen" such as<br />
<br />
{{bc|Listen 80}}<br />
<br />
and replace them with<br />
<br />
{{bc|Listen 127.0.0.1:80}}<br />
<br />
For MySQL open the file xampp\mysql\bin\my.cnf find the section "[mysqld]" and add this line<br />
<br />
{{bc|1=bind-address=localhost}}<br />
<br />
After starting the services, verify the result by going to a command window and start and execute:<br />
<br />
{{bc|netstat -a -n}}<br />
<br />
For the entries marked as LISTEN in the last column, look at the Listen column. It should always start with 127.0.0.1 or ::1 but not with 0.0.0.0.</div>Salamynder