Here is how I enabled WebDAV on Fedora 16 (before starting, you need to know how to use a terminal/shell and change into root account from terminal/shell):
- I opened up ports 80 and 443 for the firewall
- I disabled SELinux
- Open up the file vi /etc/sysconfig/selinux by typing in the command vi /etc/sysconfig/selinux as root inside a terminal
- Change the line that says SELINUX=enforcing to SELINUX=disabled
- Save the /etc/sysconfig/selinux file and get out of vi
- Reboot the machine
- I installed Apache Web Server
- Inside a terminal as root, type in the command yum -y install httpd
- Edit the file vi /etc/httpd/conf/httpd.conf by typing in the command vi /etc/httpd/conf/httpd.conf inside a terminal as root user
- Change line #43 to ServerTokens Prod
- Change line #75 to KeepAlive On
- Change line #261 to root@localhost
- Change line #275 to ServerName localhost:80
- Change line #337 to AllowOverride All
- Change line #401 to DirectoryIndex index.html index.php
- Change line #535 to ServerSignature Off
- Comment out the line #758 to something like this #AdDefaultCharset UTF-8
- Save the file /etc/httpd/conf/httpd.conf and get out of vi
- Type the command systemctl start httpd.service inside the terminal as root user to start Apache web server
- Type the command systemctl enable httpd.service to enable the starting of Apache web server on each fresh boot
- Install PHP by typing command yum -y install php php-mbstring php-pear inside a terminal as root user
- Type the command systemctl restart httpd.service inside a terminal as root user to restart Apache web server
- Configuring SSL for Apache to serve websites in SSL mode (i.e., HTTPS) by installing mod_ssl, so type the command yum -y install mod_ssl inside a terminal as root user
- Edit the file vi /etc/httpd/conf.d/ssl.conf by typing in the command vi /etc/httpd/conf.d/ssl.conf inside a terminal as root user
- Uncomment the line #78 to DocumentRoot “/var/www/html”
- Uncomment the line #79 to ServerName localhost:443
- Uncomment line #112 if it’s not yet uncommented, so the line should look like this SSLCertificateFile /etc/pki/tls/certs/localhost.crt
- Uncomment the line #119 if it’s not yet uncommented, so the line should look like this SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
- Save the file /etc/httpd/conf.d/ssl.conf and get out of vi
- Type the command systemctl restart httpd.service to restart the Apache web server
- Create WebDAV server/protocol
- Inside a terminal as root user, type in the command mkdir /home/WebDAV to create a directory named WebDAV
- Change the owner for directory WebDAV by typing in the command chown apache. /home/WebDAV inside a terminal as root user
- Change permission for WebDAV directory to 770 by typing in the command chmod 770 /home/WebDAV inside a terminal as root user
- Make a webdav.conf file to configure WebDAV server by typing in the command vi /etc/httpd/conf.d/webdav.conf inside a terminal as root user
- Type the lines below into the file /etc/httpd/conf.d/webdav.conf using vi editor:
- Alias /share /home/WebDAV
- <location /share>
- DAV On
- SSLRequireSSL
- Options None
- AuthType Basic
- AuthName WebDAV
- AuthUserFile /etc/httpd/conf/.htpasswd
- <LimitExcept GET OPTIONS>
- Order allow,deny
- Allow from 192.168.1.
- Require valid-user
- </LimitExcept>
- </Location>
- Stop typing the stuffs into the file /etc/httpd/conf.d/webdav.conf and save it and get out of vi
- Type the command htpasswd -c /etc/httpd/conf/.htpasswd fedora inside a terminal as root user to add password for fedora user to use WebDAV server
- You will be asked to create a password and confirm password, so type in the same password twice
- Now you need to restart the Apache server by typing in the command systemctl restart httpd.service inside a terminal as root user
Log into the WebDAV server by using https://192.168.1.(enter the last bit of number for your server IP address here)/share. You will be asked to enter username and password. The username should be fedora, and the password is the password that you had created earlier.
Troubleshooting: You should check to see if you can ping your Apache server. Check to see if Apache server has a daemon running (i.e., ps aux | grep httpd). Check to make sure firewall ports 80 and 443 are opened. Check to make sure SELinux is disabled. Check to see the configuration file for httpd.conf is correctly configured. Check to see the configuration file for webdav.conf is correctly configured. If permission 770 for /home/WebDAV isn’t working, try to change it to 755 or 777. Make sure you had enabled SSL for Apache correctly. If all failed, you might want to reboot Apache and to see if problems could be resolved this way.
Related articles
- imabonehead: RedHat / CentOS Install and Configure Cacti Network Graphing Tool (cyberciti.biz)
- Linux: 20 PHP Security Best Practices For Sys Admins (cyberciti.biz)
- How To Set Up An Apache Web Server In 3 Easy Steps (makeuseof.com)
- What is limitipconn ? Steps to install limitipconn. (pankajkhalkar.wordpress.com)
- Restoring a cPanel Server From a Crashed Hard Disk OR Migrating a Cpanel Server (linuxserverguide.co.cc)
- Protection for sensitive files when using Apache on an HFS+ volume (macosxhosting.wordpress.com)
- mod_ssl on a mac (osxhosting.wordpress.com)
- A generic juju charm for Django apps (micknelson.wordpress.com)
- Setting up A High Availability Cluster (Heartbeat) On CentOS (vijaynayani.wordpress.com)
- Apache + PHP + MySQL on Ubuntu 11.04 (codingexplorer.wordpress.com)
- Install Status.Net testing from Git on Fedora (heuristically.wordpress.com)
- Setting up an SSL secured Webserver with CentOS (vijaynayani.wordpress.com)
- OS X 10.7 Lion Development: MacPorts (echodittolabs.org)
- Cacti installation on centos (linuxserverguide.co.cc)
- Changing context in SELinux (ederscubicle.wordpress.com)
- Apache is tricky (ebiztechs.wordpress.com)
- Tiny Web Proxy and Content Filtering Appliance on CentOS 6 (version 1.4) (sichent.wordpress.com)
- Applying Security Workarounds in the RightScale Universe (rightscale.com)
- WebDAV authentication (wiki.archlinux.org)
- WebDAV (wiki.archlinux.org)
- Baseline apache server config (preferred) on CentOS6 with SElinux (mbrownnyc.wordpress.com)
- Setting up a PHP development environment (teknonics.wordpress.com)
- Run Dart in Apache web server (news.dartlang.org)
- Cloudless Office on iPad (kynosarges.wordpress.com)
- Howto- Install LAMP server in Fedora 17 (unixmen.com)
- Virtual Host + Apache httpd server + Tomcat + mod_jk connector (javacodegeeks.com)