Getting .htaccess to work on windows apache
Could figure out how to actually write the .htaccess file in windows as when i tried to rename the txt file I created to .htaccess it popped up an error saying “You must type a file name”.
The solution:
1. Open up notepad
2. Write the contents of your .htaccess
3. Save as
4. “.htacess” – Make sure you keep the speech marks.
5. Sorted
SSH Commands for FTP
Ok so one of my servers is with 1and1 and they provide free backup space via ftp. However you can only access it via the server you have with them, this means logging into your server using putty (SSH) from your desktop then logging into the backup server.
To do this:
1. From a command prompt you would use the ftp command ‘ftp backup_server_name.info’
2. Enter the username, then the password.
3. Use the make directory command to create a directory: ‘mkdir
testDirectory’
The reason I wanted to make a directory is so I can automate the server backup per domain via the plesk control panel.
SSH Mysql command line
Ok so i had a huge amount of trouble trying to upload a sqldump file (large sql file) into the mysql database with phpmyadmin. It kept timing out, even when I increased the timeout and upload file size larger in the php.ini file. So logged in using Putty and used the following SSH commands.
Show how many current open connections there are to mysql
mysqladmin processlist |wc -l
MySQL Dump
mysqldump -u username -ppassword dbname > file.sql
so if my username = alice, password = madhatter database name = wonderlanddb and I wanted to write to a file called sqlbackup.sql and the folder http://www.lenatsu.co.uk/databackup/ I would type:
mysqldump -u alice -pmadhatter wonderlanddb > /var/www/vhosts/lenatsu.co.uk/httpdocs/databackup/sqlbackup.sql
If a file ends in .zip (for example, file.zip) type:
unzip file.zip
If a file ends in .tar (e.g., file.tar) type:
tar -zxvf file.tar.gz
If a file ends in .gz (e.g. file.gz) type:
gzip -d file.gz
If a file ends in .tar.gz (e.g. file.tar.gz) type:
gzip -d file.tar.gz
and then
tar -xvf file.tar
Importing MySQL database
mysql -uusername -ppassword database_name < file.sql
So i would type:
mysql -u alice -pmadhatter wonderlanddb < /var/www/vhosts/lenatsu.co.uk/httpdocs/databackup/sqlbackup.sql
Right if it comes up with some rubbish like
/*!40101 mysql
then it ismost likely you have put “mysqldump” at the beginning of the command instead of “mysql”, last time it happened to me it took a couple of hair pulling hours to figure out why.
Recent Posts
- Diary of a Startup: I’ve Just Applied to Seedcamp
- Diary of a Startup: Create a startup for £14
- Sendmail on Ubuntu
- Adobe Air with Netbeans
- Best Firefox Plugins for SEO aka Addons
- Setup Ubuntu as a Web Server
- Changing Plesk Fast CGI to Apache PHP with ZF
- How to Access PUT data in Zend Framework
- 30 minutes until 30!
- Google Analytics Benchmarking Newsletter July 2011
My External Links
Twitter Updates
- I'm at Earls Restaurant (229 Banff Ave, Wolf St, Banff) http://t.co/mYqKENLt 3 days ago
- New Local Dark Ale. Lovely @ Earl's - Banff http://t.co/otFtzHbQ 1 week ago
- I'm at Calgary International Airport (YYC) (2000 Airport Rd. N.E., Calgary) w/ 7 others http://t.co/IRI8zsHj 1 week ago
- I'm at BA Galleries Club Lounge South (at Terminal 5, LHR Airport, Heathrow) w/ 3 others http://t.co/FikQ8bSQ 1 week ago
- I'm at Terminal 5 (LHR Airport, 234 Bath Rd., Hounslow) w/ 8 others http://t.co/IbyWsNNf 1 week ago
- I'm at Yum Yum (5B Brewery Place, Brewery Wharf, Leeds) http://t.co/DKzTstpt 2 weeks ago
- RT @YahooFinance: The Case for a 21-Hour Work Week http://t.co/UFru9Pwy 3 weeks ago
- How Facebook's Expected $100 Billion IPO Breaks Down [INFOGRAPHIC] http://t.co/GxGMffP6 via @mashable 3 weeks ago
- I'm at Old Broadcasting House (Leeds Metropolitan University, at Civic Quarter, Leeds) w/ 4 others http://t.co/8M32KNy5 3 weeks ago
- Start 2012 by Taking 2 Minutes to Clean Your Apps Permissions. http://t.co/ltxMfrow 1 month ago




