Вы находитесь на странице: 1из 3

yum remove -y httpd

yum install -y httpd

cd /etc/httpd/conf/

cp /etc/httpd/conf/httpd.conf httpd.conf-bck

rm -f /etc/httpd/conf.d/welcome.conf

sed -i 's,ServerAdmin root@localhost,ServerAdmin admin@localhost,g'


/etc/httpd/conf/httpd.conf

sed -i 's,#ServerName www.example.com:80,ServerName www.pagina2016.com:80,g'


/etc/httpd/conf/httpd.conf

sed -i 's,AllowOverride None,AllowOverride All,g' /etc/httpd/conf/httpd.conf

sed -i 's,DirectoryIndex index.html,DirectoryIndex index.html index.cgi


index.php,g' /etc/httpd/conf/httpd.conf

sed -i '353a # server response header\nServerTokens Prod\n# keepalive is


ON\nKeepAlive On' /etc/httpd/conf/httpd.conf

systemctl stop httpd

systemctl start httpd


systemctl enable httpd

==================================================================

touch /var/www/html/index.html

sed -i '1a # server response header\nServerTokens Prod\n# keepalive is


ON\nKeepAlive On' /etc/httpd/conf/httpd.conf
sed -i '1i <html>\' /var/www/html/index.html

[3] Create a HTML test page and access to it from client PC


with web browser. It's OK if following page is shown.
[root@www ~]# vi /var/www/html/index.html

<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>
+
sed -i '1i <aaaaaaa>\' /var/www/html/index.html ===> agregar una linea

sed -i '1a # server response header\' /etc/httpd/conf/httpd.conf

sed -i '353a # server response header\nServerTokens Prod\n# keepalive is


ON\nKeepAlive On' /var/www/html/index.html

Escritorio]# sed -i '353a # server response header\nServerTokens Prod\n# keepalive


is ON\nKeepAlive On' /etc/httpd/conf/httpd.conf

IncludeOptional conf.d/*.conf=

IncludeOptional conf.d/*.conf=

sed -i 's,IncludeOptional conf.d/*.conf=,IncludeOptional conf.d/*.conf=,g'


/etc/httpd/conf/httpd.conf

sed -i 's,IncludeOptional conf.d/*.conf=,IncludeOptional conf.d/*.conf=\# add


follows to the end,g' /etc/httpd/conf/httpd.conf

** sed -i 's/IncludeOptional conf.d/*.conf=/IncludeOptional conf.d/*.conf=\n# add


follows to the end/g' /etc/httpd/conf/httpd.conf
ritorio]# sed -i 's/dos/dos\nadicional/g' /home/usuario/Escritorio/1

sed -e 's,IncludeOptional conf.d/*.conf=,IncludeOptional


conf.d/*.conf=\n123456/g' /etc/httpd/conf/httpd.conf

# add follows to the end


# server's response header
ServerTokens Prod
# keepalive is ON
KeepAlive On

sed 's/2222222222222222/No alimenten\nal troll/' texto

1111111111111111
No alimenten
al troll 's/
3333333333333333

\n -> new line

Solo insertar:
sed 's/2222222222222222/2222222222222222\nNo alimenten\nal troll/' texto
1111111111111111

Sed -i '12a\ \' /etc/named.rfc1912.zones

Вам также может понравиться