<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://knowledgenerd.net/index.php?action=history&amp;feed=atom&amp;title=Apache</id>
	<title>Apache - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://knowledgenerd.net/index.php?action=history&amp;feed=atom&amp;title=Apache"/>
	<link rel="alternate" type="text/html" href="https://knowledgenerd.net/index.php?title=Apache&amp;action=history"/>
	<updated>2026-10-30T15:22:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://knowledgenerd.net/index.php?title=Apache&amp;diff=27&amp;oldid=prev</id>
		<title>Creator: Created page with &quot;Apache is a open source HTTP Server.  == Installation ==  * Get the package from: http://apache.org  == Configuring and administration==  Apache 2.0 configuration files are in...&quot;</title>
		<link rel="alternate" type="text/html" href="https://knowledgenerd.net/index.php?title=Apache&amp;diff=27&amp;oldid=prev"/>
		<updated>2019-09-08T21:36:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Apache is a open source HTTP Server.  == Installation ==  * Get the package from: http://apache.org  == Configuring and administration==  Apache 2.0 configuration files are in...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Apache is a open source HTTP Server.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
* Get the package from:&lt;br /&gt;
http://apache.org&lt;br /&gt;
&lt;br /&gt;
== Configuring and administration==&lt;br /&gt;
&lt;br /&gt;
Apache 2.0 configuration files are in the directory '''/etc/apache2/'''&lt;br /&gt;
* main configuration file: apache2.conf (httpd.conf exists for compatibility issues)&lt;br /&gt;
&lt;br /&gt;
'''folders:'''&lt;br /&gt;
&lt;br /&gt;
'''sites-available''' -  A list of configuration files - one per site. A blank install will contain the file default. The system admin can have as many sites here as they need - however - they will not all be active.&lt;br /&gt;
&lt;br /&gt;
'''sites-enabled''' -   A list of symlinks to configuration files in sites-available. A blank install will contain a symlink 000default to sites-available/default. The sites listed here are the sites which will be active. The site to be used if no virtual hosts match will be the first file found (hence the 000 on 000default).&lt;br /&gt;
&lt;br /&gt;
'''mods-available''' -   A list of configuration files - one or more per module. Each dpkg installed module will add files here. e.g. php4.conf and php4.load are added with the libapache2-mod-php package. Again - the system admin can install whatever modules they wish - however - until they are set available they will not be active.&lt;br /&gt;
&lt;br /&gt;
'''mods-enabled''' -  A list of symlinks to configuration files in modes-available. Only modules linked in here will be activated on the webserver.&lt;br /&gt;
&lt;br /&gt;
=== htaccess ===&lt;br /&gt;
&lt;br /&gt;
.htaccess file configuration examples: [[Htaccess]]&lt;br /&gt;
&lt;br /&gt;
=== Website Configuration File ===&lt;br /&gt;
&lt;br /&gt;
Example of website configuration file: httpd.conf or /etc/apache2/sites-enabled/websitename.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Commands e.g. Restart Apache ===&lt;br /&gt;
&lt;br /&gt;
* Use the chkconfig command to configure Apache to start at boot:&lt;br /&gt;
 $chkconfig httpd on -- not working on ubuntu server&lt;br /&gt;
&lt;br /&gt;
* Use the following scripts to control Apache:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
start apache ............... $/etc/init.d/httpd start&lt;br /&gt;
stop apache ................ $/etc/init.d/httpd stop&lt;br /&gt;
restart apache ............. $/etc/init.d/httpd restart&lt;br /&gt;
&lt;br /&gt;
Ubuntu server:&lt;br /&gt;
start apache ............... $/etc/init.d/apache2 start&lt;br /&gt;
stop apache ................ $/etc/init.d/apache2 stop&lt;br /&gt;
restart apache ............. $/etc/init.d/apache2 restart&lt;br /&gt;
reload apache's settings ... $/etc/init.d/apache2 reload&lt;br /&gt;
force to reload settings ... $/etc/init.d/apache2 force-reload&lt;br /&gt;
start cacheclean ........... $/etc/init.d/apache2 start-htcacheclean&lt;br /&gt;
stop cacheclean?? .......... $/etc/init.d/apache2 stop-htcacheclean&lt;br /&gt;
apache's status ............ $/etc/init.d/apache2 status&lt;br /&gt;
   if running prints e.g. &amp;quot;Apache is running (pid 6135)&amp;quot; else no output.&lt;br /&gt;
Enable site ................ $a2ensite&lt;br /&gt;
Disable site ............... $a2dissite&lt;br /&gt;
Enable mod ................. $a2enmod&lt;br /&gt;
Disable mod ................ $a2dismod&lt;br /&gt;
&lt;br /&gt;
PHP:&lt;br /&gt;
php-fastcgi restart ........ $/etc/init.d/php-fastcgi restart&lt;br /&gt;
&lt;br /&gt;
Mac OS X:&lt;br /&gt;
The apachectl command act as Apache HTTP Server control interface (ctl = control tool?).&lt;br /&gt;
httpd command seems to work somehow like alias to apachectl. type httpd -h to see available options.&lt;br /&gt;
&lt;br /&gt;
start apache ............... $sudo apachectl start&lt;br /&gt;
stop apache ................ $sudo apachectl stop&lt;br /&gt;
restart apache ............. $sudo apachectl restart&lt;br /&gt;
show apache settings ....... $sudo apachectl -S&lt;br /&gt;
show apachectl commands .... $sudo apachectl -?&lt;br /&gt;
list compiled modules ...... $httpd -l  (list every module that is compiled into the server)&lt;br /&gt;
check if apache is running . $ps aux | grep httpd (you should find apache process running in /usr/sbin/httpd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* You can test whether the Apache process is running with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pgrep httpd&lt;br /&gt;
$ps ax | grep httpd&lt;br /&gt;
&lt;br /&gt;
Ubuntu server:&lt;br /&gt;
pgrep apache2&lt;br /&gt;
$ps ax | grep apache2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Restart php-fastcgi ===&lt;br /&gt;
&lt;br /&gt;
For example when new module is loaded to server you have to restart php-fastcgi to start using the module&lt;br /&gt;
 /etc/init.d/php-fastcgi restart&lt;br /&gt;
&lt;br /&gt;
=== Restart php ===&lt;br /&gt;
&lt;br /&gt;
[[Nginx#Restart_PHP]]&lt;br /&gt;
&lt;br /&gt;
=== Symlinks ===&lt;br /&gt;
&lt;br /&gt;
Symlinks...&lt;br /&gt;
&lt;br /&gt;
=== Virtual Hosts ===&lt;br /&gt;
&lt;br /&gt;
Add virtual hosts / aliases.&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
1. Uncomment the following include statement from &amp;lt;code&amp;gt;bin\apache\apache2.4.9\conf\httpd.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Virtual hosts&lt;br /&gt;
#Include conf/extra/httpd-vhosts.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit bin\apache\apache2.4.9\conf\extra\httpd-vhosts.conf and check that the default localhost settings are right for your www-root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# VirtualHost example:&lt;br /&gt;
# Almost any Apache directive may go into a VirtualHost container.&lt;br /&gt;
# The first VirtualHost section is used for all requests that do not&lt;br /&gt;
# match a ServerName or ServerAlias in any &amp;lt;VirtualHost&amp;gt; block.&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerAdmin webmaster@localhost&lt;br /&gt;
    DocumentRoot &amp;quot;d:/wamp/www&amp;quot;&lt;br /&gt;
    ServerName localhost&lt;br /&gt;
    ErrorLog &amp;quot;logs/localhost-error.log&amp;quot;&lt;br /&gt;
    CustomLog &amp;quot;logs/localhost-access.log&amp;quot; common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then add the following code for your examplesite.local alias:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;VirtualHost *:80&amp;gt;&lt;br /&gt;
    ServerAdmin webmaster@examplesite.local&lt;br /&gt;
    DocumentRoot &amp;quot;d:/wamp/www/examplesite&amp;quot;&lt;br /&gt;
    ServerName examplesite.local&lt;br /&gt;
    ServerAlias www.examplesite.local&lt;br /&gt;
    ErrorLog &amp;quot;logs/examplesite-error.log&amp;quot;&lt;br /&gt;
    CustomLog &amp;quot;logs/examplesite-access.log&amp;quot; common&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Edit your hosts-file and add following line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
127.0.0.1	      examplesite.local&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable Apache's url rewrite module (mod_rewrite) ===&lt;br /&gt;
&lt;br /&gt;
Use a2enmod command (as in &amp;quot;apache2 enable module &amp;lt;module&amp;gt;&amp;quot;)&lt;br /&gt;
 a2enmod rewrite&lt;br /&gt;
restart apache to activate new configuration&lt;br /&gt;
 /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Logs (Access And Error) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find -name error.log&lt;br /&gt;
find -name access.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example locations for mysql and php error logs + access log:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./var/log/mysql/error.log&lt;br /&gt;
./var/log/apache2/error.log&lt;br /&gt;
./var/log/apache2/access.log&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
=== PHP-Error Messages Not Showing In Browser Or Log Files ===&lt;br /&gt;
&lt;br /&gt;
Check from the php.ini that following settings are true:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
display_errors = On&lt;br /&gt;
display_startup_errors = On&lt;br /&gt;
log_errors = On&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reload Apache's settings:&lt;br /&gt;
 /etc/init.d/apache2 reload&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fatal error: Call to undefined function curl_init() in /var/www/viddler/phpviddler/phpviddler.php on line ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* You need to install PHP/CURL module (and sometimes cURL also)&lt;br /&gt;
&lt;br /&gt;
* Install the php5-curl package&lt;br /&gt;
 sudo apt-get install php5-curl&lt;br /&gt;
&lt;br /&gt;
* After installing PHP/CURL module you need to restart php-fastcgi&lt;br /&gt;
 /etc/init.d/php-fastcgi restart&lt;br /&gt;
&lt;br /&gt;
* Older php-curl &lt;br /&gt;
 $sudo apt-get install php-curl&lt;br /&gt;
&lt;br /&gt;
* To install cURL&lt;br /&gt;
 sudo apt-get install curl&lt;br /&gt;
&lt;br /&gt;
* You need to add more repositories if you got following error:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Reading package lists... Done&lt;br /&gt;
Building dependency tree... Done&lt;br /&gt;
E: Couldn't find package php4-gd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add extra repositories using the Synaptic Package Manager&lt;br /&gt;
System --&amp;gt; Administration --&amp;gt; Synaptic Package Manager --&amp;gt; settings --&amp;gt; repositories&lt;br /&gt;
Install from SPM by typing &amp;quot;php5-curl&amp;quot; to quick search.&lt;br /&gt;
&lt;br /&gt;
or from command line:&lt;br /&gt;
&lt;br /&gt;
Make a copy of repositories list&lt;br /&gt;
sudo cp -p /etc/apt/sources.list /etc/apt/sources.list_backup&lt;br /&gt;
&lt;br /&gt;
edit list and add needed rows&lt;br /&gt;
gksudo gedit /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Update package list&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
&lt;br /&gt;
* restart the apache web server&lt;br /&gt;
 $sudo /etc/init.d/apache2 restart&lt;br /&gt;
&lt;br /&gt;
=== Test If CLI-PHP Is Installed On The Server ===&lt;br /&gt;
&lt;br /&gt;
Print php version:&lt;br /&gt;
 php -v&lt;br /&gt;
&lt;br /&gt;
Try to execute command line php:&lt;br /&gt;
 php -r &amp;quot;echo 'Hello World';&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Web servers]]&lt;br /&gt;
[[Category:Linux commands]]&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Creator</name></author>
		
	</entry>
</feed>