I am working on an HTTP server which is supposed to only allow a certain amount of connections per user. How do I gracefully tell the user that more than n
connections are not permitted. I tried answering the n+1
th request with a 403 but apparently that kills the whole download. (At least with DownThemAll!)
niklasfi's questions
I have script for downloading large files in a queue. Now I would really appreciate it, if I had a decent log. Specifying the -o
or -a
option is apparently specially made for that, however as of the time I am writing this "very large files", as the manpage states, are no longer 50m of size but rather gigabytes. --progress=dot:mega
produces 1000 lines of output (plainly it will be 3000*80 dots ('.')) just for a 3GB file. So I am wondering: is there any way to customize the progress style settings, so that i can actually make use of the log feature?
Hello the interesting line in my crontab looks like this: (edited & saved it by running crontab -e)
23 * * * * rsync -av --delete [email protected]:/var/www/ /home/niklas >> /home/niklas/scripts/logfile
but .. this line does nothing (at the 24th minute no bandwidth is used, no output is in the logfile) can someone tell me what is wrong?
BTW: the authentification for the server works via a passwordless pgp key. that is why the user needs to be 'niklas'
EDIT:
ran type rsync
which returned /usr/bin/rsync
but that is already on the path:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
EDIT2:
created /usr/bin/backup containing:
rsync -av --delete [email protected]:/var/www/ /home/niklas/server4you_www >> /home/niklas/scripts/logfile
chmod +x'ed it and changed the entry in chrontab to
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16 * * * * /usr/bin/backup
still... its not working, though /var/log/syslog sais:
Aug 1 15:16:01 niklas-desktop CRON[9421]: (niklas) CMD (/usr/bin/backup)
please help
EDIT3:
Changing
rsync -av --delete [email protected]:/var/www/ /home/niklas/server4you_www >> /home/niklas/scripts/logfile
to
/usr/bin/rsync -av --delete [email protected]:/var/www/ /home/niklas/server4you_www >> /home/niklas/scripts/logfile
as expected does not alter the (unsatisfying) result. however `putting echo 'xyz' > log writes xyz into the log file
so... as you might guess... my issue is still not resolved.
adding a || echo "rsync died with error code $?"
to the backup script returned:
rsync died with error code 5
which as http://wpkg.org/Rsync_exit_codes suggests means "Error starting client-server protocol" so i guess something is fishy about ssh. again i am using a pgp key with a password but that password is by default unlocked by the keyring on startup so that i can ssh [email protected] without entering a password. Is it possible to send rsync the password of the ssh key?
I am currently in the Process of moving from one server to another. And I am currently setting up my apache2. However on the old server I used several subdomains. Now i wanted to test these subdomains on the new server, however it seems hat subdomain.xx.xx.xx.xx (subdomain.ip-address) does not seem to work. Is this impossible or is it just me getting the config wrong?
my config
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/tld.com
<Directory>
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/tld.com>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/subdomain
ServerName subdomain.62.75.145.146
</VirtualHost>
I am experiencing the following problem when trying to connect to the phpmyadmin site of my server:
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.
Error
MySQL said: Documentation
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
Invalid hostname for server 1. Please review your configuration.
The problematic part is, that I do not get to enter a Password, though the phpmyadmin/config.inc.php has all values set to the default e.g. the $cfg['Servers'][$i]['connect_type'] is set to "cookie". It works, if I change the conenct_type to "http". And of course mysql itself works, too when accessed through the PHP scripts running on the server as well as when accessed through the shell.
I appreciate your help.