Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Script to configure logical port for apache logs
- #variable used to identify if server is using EasyApache 4 or not
- file=/etc/cpanel/ea4/is_ea4
- #function to apply configuration in servers using EasyApache 3
- ea3()
- sed -i.bak 's/%h/[%h]:%{remote}p/g' /var/cpanel/conf/apache/main
- }
- #function to apply configuration in servers using EasyApache 4
- ea4(){
- echo 'LogFormat "[%h]:%{remote}p %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined' >> /etc/apache2/conf.d/MarcoCivil.conf
- }
- #backing up httpd.conf file
- bak(){
- cp /etc/apache2/conf/httpd.conf /etc/apache2/conf/httpd.conf.bak
- }
- #Main function
- main(){
- bak
- if [ -e $file ]; then
- ea4
- else
- ea3
- fi
- #Rebuilding apache configurations and restarting service to apply modifications
- /scripts/rebuildhttpdconf
- /scripts/restartsrv_apache
- }
- main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement