How To Install Apache Server Source Package On Linux Server?
Install Apache server
http://httpd.apache.org/docs/2.4/install.html
Is a good place to start.
Weedpacket's link looks very helpful.
I prefer to rely on package managers when working with linux because they tend to automatically sort out the required dependencies. Package managers also make it easy to update your software when the package maintainers publish security fixes and upgrades. The down side of using them is that you sometimes must put up with old versions of software. For example, my workstation is running Ubuntu 12.04.5 (which is also pretty old) and when I used its package manager to install PHP, it installs php 5.3.10 which is quite old. Granted, this php 5.3.10 is a special variant that includes a lot of security patches and bug fixes and stuff, but it's not the latest by any means.
The package manager on your system will depend on the linux distro.
Debian and Ubuntu use apt-get.
CentOS and RedHat use yum.
On my workstation, I could type this command:
apt-cache search apache | grep "^apache"
which yields a few results:
apache2 - Apache HTTP Server metapackage
apache2-doc - Apache HTTP Server documentation
apache2-mpm-event - Apache HTTP Server - event driven model
apache2-mpm-prefork - Apache HTTP Server - traditional non-threaded model
apache2-mpm-worker - Apache HTTP Server - high speed threaded model
apache2-prefork-dev - Apache development headers - non-threaded MPM
apache2-threaded-dev - Apache development headers - threaded MPM
apache2-utils - utility programs for webservers
apache2.2-bin - Apache HTTP Server common binary files
apache2.2-common - Apache HTTP Server common files
apache2-mpm-itk - multiuser MPM for Apache 2.2
apache2-suexec - Standard suexec program for Apache 2 mod_suexec
apache2-suexec-custom - Configurable suexec program for Apache 2 mod_suexec
apachetop - Realtime Apache monitoring tool
I don't recall offhand which is the best to install. I know that on my machine it's apache2-mpm-prefork. So I could install that with this command:
sudo apt-get install apache2-mpm-prefork
sneakyimp;11050061 wrote:Weedpacket's link looks very helpful.
I prefer to rely on package managers when working with linux because they tend to automatically sort out the required dependencies. Package managers also make it easy to update your software when the package maintainers publish security fixes and upgrades. The down side of using them is that you sometimes must put up with old versions of software. For example, my workstation is running Ubuntu 12.04.5 (which is also pretty old) and when I used its package manager to install PHP, it installs php 5.3.10 which is quite old. Granted, this php 5.3.10 is a special variant that includes a lot of security patches and bug fixes and stuff, but it's not the latest by any means.
The package manager on your system will depend on the linux distro.
Debian and Ubuntu use apt-get.
CentOS and RedHat use yum.
On my workstation, I could type this command:
apt-cache search apache | grep "^apache"
which yields a few results:
apache2 - Apache HTTP Server metapackage apache2-doc - Apache HTTP Server documentation apache2-mpm-event - Apache HTTP Server - event driven model apache2-mpm-prefork - Apache HTTP Server - traditional non-threaded model apache2-mpm-worker - Apache HTTP Server - high speed threaded model apache2-prefork-dev - Apache development headers - non-threaded MPM apache2-threaded-dev - Apache development headers - threaded MPM apache2-utils - utility programs for webservers apache2.2-bin - Apache HTTP Server common binary files apache2.2-common - Apache HTTP Server common files apache2-mpm-itk - multiuser MPM for Apache 2.2 apache2-suexec - Standard suexec program for Apache 2 mod_suexec apache2-suexec-custom - Configurable suexec program for Apache 2 mod_suexec apachetop - Realtime Apache monitoring tool
I don't recall offhand which is the best to install. I know that on my machine it's apache2-mpm-prefork. So I could install that with this command:
sudo apt-get install apache2-mpm-prefork
Thanks for good response, I gotten many solution from this. But If I talk about configuring Apache Server on CentOS, RedHat, Linux etc then it's occurring some kind of error like httpd configuration file , NameVirtualHost *:80. So let me know which type of error is this and how can I solve it.
Well, I'm having a bit of trouble understanding what you're asking.
There's quite a bit of material on the WWW about Apache configuration. I've always found the Apache Documentation a pretty good reference ... perhaps as good as the PHP Manual and almost as good as the FreeBSD Manual.
It would be very helpful if you would include the text of any error messages in your posts, if you really want us to help you.
ammejohn10;11050501 wrote:Thanks for good response, I gotten many solution from this. But If I talk about configuring Apache Server on CentOS, RedHat, Linux etc then it's occurring some kind of error like httpd configuration file , NameVirtualHost *:80. So let me know which type of error is this and how can I solve it.
Where are you getting this error?
sneakyimp;11050567 wrote:Where are you getting this error?
Actually am going to configure Apache server for my own local IP address so that I used following code :
Name Virtual Host 192.168.65.18
<Virtual Host *: 192.168.65.18>
DocumentRoot /www/cloudapplication
ServerName www.cloudapplication.org
#Other directives here
</Virtual Host>
But when I used executed this code It's throwing an error and also recommending to use by default virtualhost:80.
Well, your code isn't quite right, hence the error. After the colon, ":", should be the port number, not the IP address.
By default, Apache will be "glomming onto all bound IP addresses" unless specifically told NOT to do so via the "Listen" directive in httpd.conf.
So, to do what you're looking at above, all you need is this:
<VirtualHost *:80>
DocumentRoot /www/cloudapplication/
ServerName www.cloudapplication.org
</VirtualHost>
However, I might also recommend setting ServerAdmin to your email address, DirectoryIndex to "index.php" or another appropriate page, CustomLog and ErrorLog and possibly "ErrorDocument 404", which would translate to a block like this:
<VirtualHost *:80>
DocumentRoot /www/cloudapplication/
ServerName www.cloudapplication.org
ServerAdmin webmaster@cloudapplication.org
DirectoryIndex index.php
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" ncsa_ext
CustomLog "|/usr/local/sbin/rotatelogs -l /www/logs/access_log.%Y.%m.%d 86400" ncsa_ext
ErrorLog /www/logs/error_log
ErrorDocument 404 /404.php
</VirtualHost>
Now, granted, this will CustomLog directive will have Apache writing a new logfile every day, so if your traffic isn't so heavy, you might not want to use "86400" as the period for the log rotation (you might prefer to wait until a certain size ... say, "10M").
dalecosp;11050695 wrote:Well, your code isn't quite right, hence the error. After the colon, ":", should be the port number, not the IP address.
By default, Apache will be "glomming onto all bound IP addresses" unless specifically told NOT to do so via the "Listen" directive in httpd.conf.
So, to do what you're looking at above, all you need is this:
<VirtualHost *:80> DocumentRoot /www/cloudapplication/ ServerName www.cloudapplication.org </VirtualHost>
However, I might also recommend setting ServerAdmin to your email address, DirectoryIndex to "index.php" or another appropriate page, CustomLog and ErrorLog and possibly "ErrorDocument 404", which would translate to a block like this:
<VirtualHost *:80> DocumentRoot /www/cloudapplication/ ServerName www.cloudapplication.org ServerAdmin webmaster@cloudapplication.org DirectoryIndex index.php LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" ncsa_ext CustomLog "|/usr/local/sbin/rotatelogs -l /www/logs/access_log.%Y.%m.%d 86400" ncsa_ext ErrorLog /www/logs/error_log ErrorDocument 404 /404.php </VirtualHost>
Now, granted, this will CustomLog directive will have Apache writing a new logfile every day, so if your traffic isn't so heavy, you might not want to use "86400" as the period for the log rotation (you might prefer to wait until a certain size ... say, "10M").
Ok, I will definitely try this entire code and I hope I solve my code error with the same code. Thanks for helping me and specially to provide this code.