0% found this document useful (0 votes)
19 views

Web Server Commands

The document discusses how to configure an Apache web server including installing Apache, configuring the firewall to allow traffic on port 80, changing the default port Apache listens on to 8080, and setting the document root directory.

Uploaded by

rajoni8225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Web Server Commands

The document discusses how to configure an Apache web server including installing Apache, configuring the firewall to allow traffic on port 80, changing the default port Apache listens on to 8080, and setting the document root directory.

Uploaded by

rajoni8225
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

Yum server configure


df -h
mkdir /dvd
mount -o loop /dev/sr0 /dvd
cd /dvd
ls
cd ~
cd /etc/yum.repos.d
ls
vim local.repo
[qwert]
name=local
baseurl=file:///dvd
enabled=1
gpgcheck=0
:wq!
yum repolist

2.create one website with basic authication


yum -y install httpd
systemctl enable httpd
systemctl start httpd
firewall-cmd --zone=public --add-port=80/tcp --permanent
echo "welcome to site1" > /var/www/html/index.html

3.How to change default port in apache server


firewall-cmd --zone=public --add-port=8080/tcp --permanent
systemctl disable firewalld
echo "welcome to site1" > /var/www/html/index.html
vim /etc/httpd/conf/httpd.conf
42 change listen 9000 (port number)
sudo systemctl restart httpd (enable,start)

4.Configure apache server


root@server#yum install httpd -y
root@server#systemctl httpd
root@server#systemctl start httpd
root@server#firewall-cmd --permanent --add-service=http
root@server#firewall-cmd --permanent --add-service=http
root@server#firewall-cmd --reload
root@server#firewall-cmd --add-service==https
root@server#firewall-cmd --reload
root@server#cd /var/www/html
root@server html#vim index.html
site1
:wq!

5.How to configure Default Path in apache server


yum install httpd -y
systemctl enble httpd
systemctl start httpd
firewall-cmd --permanent --add-service httpd (s)
firewall-cmd --permanent --add-service http
firewall-cmd --reload
firewall-cmd --add-service https
firewall-cmd --reload
cd /var/www/html
vim index.html
su root
ls
ip addr (open firefox)
mkdir /test
vim index.html
vim /etc/httpd/conf/httpd.conf
#DocumentRoot "/var/www/html"
DocumentRoot "/test"
go to #<Directory "/var/www/html"/>
<Directory "/test">
:wq!
firefox
systemctl restart http
ls -Zd test
ls -Zd/var/www/html
semanage fcontexr -a -t httpd_sys_content_t '/test(/.*)?'
restorecone -vR /test

6.configure firewall in apache or web server


1 sudo systemctl status firewalld
2 sudo systemctl enable firewalld
3 sudo systemctl start firewalld
4 sudo firewall-cmd --get-services
5 sudo firewall-cmd --permanent --add-service=http
6 sudo firewall-cmd --permanent --add-service=https
7 sudo firewall-cmd --reload
8 sudo firewall-cmd --list-all

7.how to configure default port in apache server


firewall-cmd --zone=public --add port=9000/tcp --permanent
firewall-cmd --reload
systemctl disable firewalld
systemctl stop firewalld
echo "welcome to laksh domain" > var/www/html/index.com (html)
firewall-cmd --reload
vim /etc/httpd/conf/httpd.conf

2.firewall-cmd --permanent --add-service=http


firewall-cmd --reload
firewall-cmd --add-service=https
systemctl restart httpd.service
systemctl enable httpd.service
vim /etc/httpd/conf/httpd.conf
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
vim /etc/httpd/conf/httpd.conf
systemctl restart httpd.service
systemctl enable httpd.service

8.change default port


sudo vi /etc/httpd/conf/httpd.conf
Listen 80
Listen 8080
sudo systemctl restart httpd

You might also like