proftpd.conf

Posted by daxady on 3 Aprile 2015 in Config with Comments closed |
#
# To have more informations about Proftpd configuration
# look at : http://www.proftpd.org/
#
 
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
 
ServerName "ProFTPD"
#ServerType standalone
ServerType inetd
DefaultServer on
<Global>
DefaultRoot ~ psacln
AllowOverwrite on
</Global>
DefaultTransferMode binary
UseFtpUsers on
 
TimesGMT off
SetEnv TZ :/etc/localtime
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
 
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances 30
 
AllowStoreRestart on
AllowRetrieveRestart on
PassivePorts 60000 60500
 
#Following part of this config file were generate by PSA automatically
#Any changes in this part will be overwritten by next manipulation
#with Anonymous FTP feature in PSA control panel.
 
#Include directive should point to place where FTP Virtual Hosts configurations
#preserved
 
ScoreboardFile /var/run/proftpd/scoreboard
 
# Primary log file mest be outside of system logrotate province
 
TransferLog /usr/local/psa/var/log/xferlog
 
#Change default group for new files and directories in vhosts dir to psacln
 
<Directory /var/www/vhosts>
GroupOwner psacln
</Directory>
 
# Enable PAM authentication
AuthPAM on
AuthPAMConfig proftpd
 
IdentLookups off
UseReverseDNS off
 
AuthGroupFile /etc/group

PHP5 on Centos 7

Posted by daxady on 11 Marzo 2015 in Config with Comments closed |

We can install PHP5 and the Apache PHP5 module as follows:

yum -y install php

We must restart Apache afterwards:

systemctl restart httpd.service

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

nano /var/www/html/info.php
< ?php
phpinfo();
?>

Apache2 on Centos 7

Posted by daxady on 11 Marzo 2015 in Config with Comments closed |

CentOS 7.0 ships with apache 2.4. Apache2 is directly available as a CentOS 7.0 package, therefore we can install it like this:

yum -y install httpd

[root@server1 ~]# yum install httpd
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.plusline.de
* extras: mirror.23media.de
* updates: mirror.23media.de
Package httpd-2.4.6-17.el7.centos.1.x86_64 already installed and latest version
Nothing to do
[root@server1 ~]#

By default apache will be installed, if-not then please install it as shown above

Now configure your system to start Apache at boot time…

systemctl start httpd.service

systemctl enable httpd.service

In CentOS 7.0 uses Firewall-cmd, so I will customize it to allow external access to port 80 (http) and 443 (https).

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

PHP Banner rotator

Posted by daxady on 4 Marzo 2015 in Codex with Comments closed |

Define your banners

Create $banners array with the links of each banner. Then shuffle this array.

<?php
$banner1 = '<a href="BANNER1_URL" target="_blank"><img src="BANNER1_IMG_SRC" alt="BANNER1_ALT" title="BANNER1_TITLE"></a>';
$banner2 = '<a href="BANNER2_URL" target="_blank"><img src="BANNER2_IMG_SRC" alt="BANNER2_ALT" title="BANNER2_TITLE"></a>';
$banner3 = '<a href="BANNER3_URL" target="_blank"><img src="BANNER3_IMG_SRC" alt="BANNER3_ALT" title="BANNER3_TITLE"></a>';
$banner4 = '<a href="BANNER4_URL" target="_blank"><img src="BANNER4_IMG_SRC" alt="BANNER4_ALT" title="BANNER4_TITLE"></a>';
$banners = array($banner1, $banner2, $banner3, $banner4);
shuffle($banners);
?>

Display random banner

Just put this code, where you want to display your random banner

<div>
<?php print $banners[0] ?>
</div>

.htaccess not running on linux Debian – AllowOvverride Enable on Apache

Posted by daxady on 22 Febbraio 2015 in Fix with Comments closed |

Edit /etc/apache2/sites-available/default :

Locate the following section:

6
7
8
9
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all

and change AllowOverride None to:

1
AllowOverride All

Save and exit your editor.
Restart your web server:

1
/etc/init.d/apache2 restart

Vsftpd.conf example

Posted by daxady on 21 Febbraio 2015 in Config with Comments closed |
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
anonymous_enable=NO
#allow_writable_chroot=YES
local_enable=YES
write_enable=YES
virtual_use_local_privs=YES
#guest_enable=YES
local_root=/var/www/
#user_sub_token=$USER
#local_root=/home/
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=NO
xferlog_file=/var/log/vsftpd.log
#ferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
ftpd_banner=daxady's FTP server.
#chroot_list_enable=YES
#chroot_list_file=/etc/vsftpd/chroot_list
chroot_local_user=YES
hide_ids=YES
listen=YES
pam_service_name=vsftpd.virtual
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/vsftpd.user_list
tcp_wrappers=YES
chmod_enable=YES
listen_port=771

Copyright © 2015-2019 pietro.dimaio.info All rights reserved.