Linux Troubleshooting Make Easy.

Linux Learning & Troubleshooting Make Easy.

Install and Configure Apache Web Server


Download the Apache Package:

Most RedHat and Fedora Linux software products are available in the RPM format. When searching for the file, remember that the Apache RPM's filename usually starts with the word httpd followed by a version number, as in httpd-2.0.48-1.2.rpm. With Ubuntu / Debian the package name will have the apache prefix instead.





Redhat / Fedora:

Install Apache Web Server:
#  rpm -ivh httpd-2.0.48-1.2.rpm
or
# yum install httpd

Use the chkconfig command to configure Apache to start at boot:
#  chkconfig httpd on

To Start/Stop/Restart Apache:
#  service httpd start/stop/restart

You can test whether the Apache process is running with:
#  pgrep httpd


Debian / Ubuntu :


Install Apache Web Server:
#  sudo apt-get install apache
or
You can install RPM package also. But you need to do few other steps to install RPM package.
Please check the below link to install RPM package.
install-rpm-package-on-ubuntu

Use the sysv-rc-conf command to configure Apache to start at boot:
#  sysv-rc-conf apache on

To start,stop, and restart Apache :
#  /etc/init.d/apache start or stop or restart



General Configuration Steps:

The configuration file used by Apache is /etc/httpd/conf/httpd.conf in Redhat / Fedora .
And /etc/apache*/httpd.conf in Debian / Ubuntu distributions.

 To edit httpd.conf file:
#  vi /etc/httpd/conf/httpd.conf

Apache expects to find all its web page files in the /var/www/html/ directory with a generic "DocumentRoot" statement at the beginning of httpd.conf.
Edit this line to change the  DocumentRoot directory.






###############################################################################


To Create Password Authentication for a Website:

To do this, we have to create an .htaccess file in DocumentRoot folder.

Note:  <DocumentRoot> = Change it with Document Root path

#  vi <DocumentRoot>/.htaccess

AuthType Basic
AuthName "Members Only"
AuthUserFile <DocumentRoot>/.htpasswd
<limit GET PUT POST>
require valid-user
</limit>


To log in with the username admin :

#  htpasswd -c <DocumentRoot>/.htpasswd admin
##Enter a password for admin


23 comments:

Coach Factory said...

canada goose, instyler ionic styler, ugg boots, moncler, nfl jerseys, moncler, abercrombie and fitch, birkin bag, juicy couture outlet, marc jacobs, reebok outlet, moncler outlet, mac cosmetics, mcm handbags, juicy couture outlet, canada goose pas cher, celine handbags, babyliss pro, wedding dresses, north face outlet, canada goose outlet, soccer shoes, giuseppe zanotti, beats by dre, canada goose outlet, bottega veneta, chi flat iron, uggs on sale, asics shoes, north face jackets, moncler, canada goose outlet, herve leger, canada goose uk, soccer jerseys, moncler, ghd, new balance shoes, p90x3, jimmy choo shoes, mont blanc, ugg outlet, lululemon outlet, valentino shoes, ferragamo shoes, ugg, supra shoes, insanity, ugg boots, rolex watches

Coach Factory said...

hermes pas cher, lululemon, tn pas cher, hogan sito ufficiale, nike air max, longchamp, nike blazer, converse pas cher, michael kors, karen millen, roshe run, hollister, nike free, oakley pas cher, nike free pas cher, sac louis vuitton, ray ban pas cher, air force, nike roshe run, ray ban uk, air jordan, vanessa bruno, abercrombie and fitch, nike roshe, timberland, louboutin, longchamp soldes, michael kors, vans outlet, north face, nike huarache, ralph lauren pas cher, montre femme, longchamp, nike trainers, air max, burberry, louis vuitton uk, barbour, lacoste, louis vuitton, sac guess, ralph lauren, vans pas cher, sac louis vuitton, michael kors, mulberry, new balance pas cher, hollister, hollister

Coach Factory said...

michael kors outlet online, michael kors outlet store, air max, coach purses, oakley sunglasses cheap, louboutin, louis vuitton outlet online, oakley vault, louis vuitton outlet, prada outlet, louis vuitton outlet, kate spade handbags, coach outlet, michael kors outlet online, prada handbags, ray ban sunglasses, nike air max, polo ralph lauren outlet, louis vuitton handbags, michael kors outlet, burberry outlet online, longchamp handbags, gucci outlet, jordan shoes, nike shoes, longchamp handbags, nike free, coach outlet store online, ray ban outlet, louboutin outlet, polo ralph lauren outlet online, oakley sunglasses, coach outlet, kate spade outlet, coach factory outlet, chanel handbags, louis vuitton, michael kors outlet, tiffany and co, michael kors outlet online, burberry outlet online, louboutin shoes, tory burch outlet, longchamp outlet, christian louboutin shoes

ninest123 Ninest said...

ninest123 11.26
michael kors handbags, burberry factory outlet, longchamp bags, replica watches, louboutin uk, michael kors outlet, uggs outlet, prada handbags, louis vuitton outlet online, cheap oakley sunglasses, ralph lauren outlet, louis vuitton outlet, cheap jordans, louboutin shoes, louis vuitton, gucci handbags, ralph lauren polo, oakley sunglasses, oakley sunglasses, oakley sunglasses, longchamp outlet, ray ban sunglasses, longchamp outlet, nike outlet, ray ban sunglasses, christian louboutin, uggs outlet, prada outlet, nike free, michael kors outlet online, nike air max, ray ban sunglasses, uggs on sale, christian louboutin, nike air max, replica watches, michael kors outlet online, burberry outlet, uggs on sale, tiffany jewelry, louis vuitton handbags, oakley sunglasses, tiffany jewelry, uggs on sale, tory burch outlet, michael kors, louis vuitton outlet, michael kors outlet online

ninest123 Ninest said...

longchamp pas cher, timberland pas cher, polo ralph lauren uk, nike trainers uk, true religion outlet, hermes pas cher, nike roshe run pas cher, nike tn pas cher, michael kors, nike air max pas cher, michael kors uk, abercrombie and fitch UK, north face uk, north face pas cher, mulberry uk, vanessa bruno pas cher, michael kors, lunette ray ban pas cher, sac guess pas cher, longchamp soldes, nike air max uk, coach purses, louboutin pas cher, coach outlet store online, abercrombie and fitch, ralph lauren pas cher, true religion outlet, vans pas cher, hollister uk, nike free pas cher, true religion outlet, nike free, nike air max uk, ray ban uk, jordan pas cher, polo lacoste pas cher, nike blazer pas cher, hogan sito ufficiale, true religion jeans, lunette oakley pas cher, lululemon outlet, nike roshe uk, nike air max, new balance, converse, burberry pas cher, coach outlet, michael kors outlet online, nike air force

ninest123 Ninest said...

iphone 6s cases, mac cosmetics, north face outlet, oakley, vans scarpe, nike air max, hermes handbags, softball bats, ipad cases, s6 cases, louboutin, nike roshe run, gucci, vans outlet, abercrombie and fitch, celine handbags, mont blanc, valentino shoes, iphone 5s cases, ray ban, giuseppe zanotti, lululemon outlet, beats by dre, nfl jerseys, mcm handbags, bottega veneta, nike air max, iphone 6 cases, chi flat iron, insanity workout, iphone cases, converse, asics running shoes, instyler ionic styler, reebok outlet, babyliss pro, hollister clothing, north face outlet, polo ralph lauren, soccer shoes, wedding dresses, salvatore ferragamo, iphone 6 plus cases, new balance shoes, herve leger, iphone 6s plus cases, p90x workout, ghd hair, hollister, timberland boots, jimmy choo outlet, soccer jerseys

ninest123 Ninest said...

louis vuitton, pandora jewelry, moncler, pandora uk, canada goose, canada goose pas cher, barbour jackets uk, moncler, canada goose outlet, hollister, louis vuitton, moncler jackets, replica watches, toms shoes, uggs outlet, moncler, canada goose outlet, ugg pas cher, canada goose uk, lancel, ugg uk, juicy couture outlet, bottes ugg pas cher, converse shoes outlet, thomas sabo uk, karen millen uk, wedding dresses uk, sac louis vuitton, pandora charms, supra shoes, pandora jewelry, barbour, moncler pas cher, coach outlet, moncler outlet, marc jacobs, louis vuitton uk, ugg,uggs,uggs canada, swarovski jewelry, canada goose jackets, canada goose, sac louis vuitton, doke & gabbana, moncler, ugg,ugg australia,ugg italia, montre pas cher, canada goose jackets, swarovski uk, juicy couture outlet, links of london uk, moncler uk
ninest123 11.26

chenlina said...

chenlina20151219
louis vuitton outlet
michael kors bag
canada goose outlet
ugg boots
ugg boots outlet
michael kors outlet
ugg boots
canada goose jackets
michaek kors outlet
cheap ugg boots
canada goose outlet
polo ralph lauren
uggs on sale
michael kors outlet online
the north face outlet
louis vuitton outlet
cheap air max
abercrombie and fitch
canada goose outlet
ray ban sunglasses
tory burch outlet
jordan 11
uggs boots for women
oakley sunglasses
coach outlet
louis vuitton handbags
timberland outlet
ray ban sunglasses outlet
ray ban sunglasses outlet
abercrombie kids
canada goose outlet online
coach outlet store online
coach outlet
michael kors outlet
ugg boots
uggs outlet
canada goose jackets
hollister co
abercrombie & fitch
ugg boots
as

艾丰 said...

jianbin0324
nike air max
swarovski outlet
ray-ban sunglasses
michael kors outlet online
jordan shoes
michael kors canada
michael kors handbags
lebron shoes
mbt shoes
air jordan 4
mlb jerseys
links of london
mcm backpack
pandora outlet
louis vuitton handbags
prada handbags
cheap nfl jersey
ralph lauren,polo ralph lauren,ralph lauren outlet,ralph lauren italia,ralph lauren sito ufficiale
abercrombie and fitch
hermes birkin bag
cheap nike shoes
louis vuitton outlet store
michael kors outlet
michael kors handbags
louis vuitton outlet
michael kors factory outlet
hermes belt for sale
true religion jeans
mulberry outlet store
adidas outlet store
michael kors handbags
coach outlet store
air jordan shoes for sale
mac cosmetics
hermes outlet
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
nike foamposite
nfl jerseys wholesale
lebron shoes

艾丰 said...

jianbin0325
nike air max
swarovski outlet
ray-ban sunglasses
michael kors outlet online
jordan shoes
michael kors canada
michael kors handbags
lebron shoes
mbt shoes
air jordan 4
mlb jerseys
links of london
mcm backpack
pandora outlet
louis vuitton handbags
prada handbags
cheap nfl jersey
ralph lauren,polo ralph lauren,ralph lauren outlet,ralph lauren italia,ralph lauren sito ufficiale
abercrombie and fitch
hermes birkin bag
cheap nike shoes
louis vuitton outlet store
michael kors outlet
michael kors handbags
louis vuitton outlet
michael kors factory outlet
hermes belt for sale
true religion jeans
mulberry outlet store
adidas outlet store
michael kors handbags
coach outlet store
air jordan shoes for sale
mac cosmetics
hermes outlet
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
nike foamposite
nfl jerseys wholesale
lebron shoes
q

Xiaozhengm 520 said...

2016-4-7 xiaozhengm
nike basketball shoes
oakley sunglasses
michael kors outlet clearance
louis vuitton bags
replica watches
michael kors outlet
pandora jewelry
kate spade outlet
louis vuitton outlet
louis vuitton outlet
ray ban sunglasses
ray ban sunglasses
ray ban uk
coach factory outlet
oakley sunglasses
tiffany outlet
oakley sunglasses wholesale
replica watches
fitflops
nike uk
christian louboutin sale
nike sb
michael kors outlet clearance
michael kors outlet
michael kors outlet
ralph lauren
replica watches for sale
ray ban sunglasses
gucci outlet
coach outlet
michael kors outlet
tiffany and co
polo ralph shirts
cheap oakley sunglasses
michael kors handbags
nike air max 90
nike running shoes
coach outlet store online
mont blanc pens
insanity workout

chenlina said...

chenlina20160616
nike basketball shoes
nike factory outlet
toms shoes
adidas shoes
oakley vault
replica watches
timberland boots
ray ban sunglasses
cheap ray ban sunglasses
air jordans
tiffany and co
christian louboutin outlet
michael kors outlet
michael kors outlet clearance
ray ban sunglasses
nike sb shoes
christian louboutin sale
toms wedges
burberry outlet
michael kors outlet
toms outlet
polo ralph lauren
louis vuitton
asics outlet
coach factory outlet
nike air max
coach outlet store online clearances
ralph lauren outlet
louis vuitton purses
louis vuitton handbags
louis vuitton outlet
oakley sunglasses
toms outlet
coach factory outlet
giuseppe zanotti
coach outlet
kate spade handbags
cheap toms
running shoes
oakley vault
as

chenzhen said...

zhuo20160603
ray ban sunglasses
cheap oakley sunglasses
longchamp bag
cheap nike shoes
oakley vault
nike free flyknit 4.0
rolex replica watches
coach outlet store online
coach outlet online coach factory outlet
coach outlet
pandora jewelry
nike huarache
michael kors outlet store
skechers outlet
michael kors outlet clearance
hollister co
nike free run black
instyler max
ralph lauren outlet
cheap nba jerseys
north face jackets
louboutin uk
coach outlet store
cheap jordans
babyliss flat iron
cheap jordans
hugo boss outlet
oakley sunglasses
michael kors outlet clearance
ray ban sunglasses
fitflops outlet
christian louboutin outlet
michael kors outlet
ralph lauren outlet
buy red bottoms
ghd hair straighteners
bottega veneta handbags
nike air max 90

Unknown said...

michael kors outlet
jordan pas cher
ray-ban sunglasses
ghd hair straighteners
rolex watches
oakley sunglasses wholesale
tods outlet
rolex watches
hermes bags
michael kors outlet
chanyuan10.05

Gege Dai said...

air jordan 4
tiffany and co
ecco outlet
rolex uk
ugg boots
cheap jerseys wholesale
dior sunglasses
cheap jordans free shipping
louis vuitton handbags
nike roshe
20170113lck

Unknown said...

nike huarache
pandora charms
oakley sunglasses
nike huarache
redskins jerseys
longchamp le pliage
kansas city chiefs jerseys
colts jerseys
michael kors handbags outlet
hermes belt

chenmeinv0 said...

columbia shoes
ralph lauren shirts
pandora charms
mac cosmetics
michael kors outlet online
timberland outlet online
coach outlet online
polo outlet
cheap ray bans
nike huarache uk
chenyignying20170323

caiyan said...

mlb jerseys
birkenstock
cheap jerseys
coach handbags outlet
adidas nmd runner
michael kors outlet online
yeezy boost 350
air max
christian louboutin
chaussure louboutin pas cher
0407shizhong

dong dong23 said...

hermes bags
michael kors outlet
coach outlet online
burberry scarf
cheap ray ban sunglasses
ralph lauren polo
coach outlet store online
mcm belt
coach outlet store online
michael kors
2017.5.2chenlixiang

raybanoutlet001 said...

ugg boots
true religion jeans
nike huarache
coach outlet online
michael kors handbags
hugo boss sale
new england patriots jerseys
oakley sunglasses
michael kors handbags
gucci sale

xjd7410@gmail.com said...

adidas shoes
coach outlet
coach factory outlet
louis vuitton outlet
louis vuitton
nike roshe run
coach outlet
true religion canada
chrome hearts outlet
adidas nmd
chanyuan2017.06.02

chenlina said...

puma shoes
coach factory outlet
coach outlet online
canada goose outlet store
nike outlet
adidas outlet online
valentino shoes
adidas yeezy shoes
oakley sunglasses
michael kors outlet
wanglili20170623

da xu said...

mont blanc pen
polo ralph lauren
pandora charms
louboutin outlet
discount nike shoes
michael kors outlet
adidas yeezy boost
longchamp
michael kors
jordan uk
xushengda0630