Saturday, September 21, 2019

How to disable directory listings on apache running on Ubuntu

open /etc/apache2/apache2.conf

And the section of the settings that deals with listing directory in Apahce2 default root directory is this:

<Directory /var/www/>  Options Indexes FollowSymLinks  AllowOverride None  Require all granted  </Directory>  

To disable directory listing, edit the setting to be this:

<Directory /var/www/>  Options FollowSymLinks  AllowOverride None  Require all granted  </Directory>  

Save the file and restart Apache2 to load the new configuration settings.

How to disable Web server version disclosure

On Debian, Ubuntu or Linux Mint:

$ sudo vi /etc/apache2/apache2.conf

On CentOS, Fedora, RHEL or Arch Linux:

$ sudo vi /etc/httpd/conf/httpd.conf

Add the following two lines at the end of Apache config file.

1
2
ServerSignature Off
ServerTokens Prod

Then restart web server to activate the change.

Ref: http://ask.xmodulo.com/turn-off-server-signature-apache-web-server.html

Saturday, September 14, 2019

Protocol "'http" not supported or disabled in libcurl

Error: Protocol "'http" not supported or disabled in libcurl
Solution:

Ensure you are supplying curl with double quotes ("), not single quotes (')

how to enable curl in php at lunux (ubuntu) server

sudo apt-get install php7.3-curl

open /etc/php/7.3/apache2/php.ini

uncooment following line:

extension=curl

Restart apache:
sudo /etc/init.d/apache2 restart

put following line in your php file and execute in web browser

echo 'Curl: ', function_exists('curl_init') ? 'Enabled' : 'Disabled';
Some examples of perl call: