ispconfig 3 phpmyadmin 404 not found error


ln -s /usr/share/phpmyadmin /var/www/
service nginx restart

mysupermarket.com/phpmyadmin

enter user/password and login...this will redirecto below url

http://mysupermarket.com/index.php?token=81d1f26028dc0f0f625803c2d1ccd402

it will still give

ERROR 404 - Not Found!
The following error occurred:
The requested URL was not found on this server.
Please check the URL or contact the webmaster.

insert phpmyadmin between domain.com and index.php.... like below
http://mysupermarket.com/phpmyadmin/index.php?token=81d1f26028dc0f0f03c2d1ccd402#PMAURL:server=1&target=main.php&token=81d1f26028dc0f0f625803c2d1ccd402










still need to fix....


ispconfig 3 squirrelmail "Could not move/copy file. File not attached" when trying to attach a file"


1) create directory in /usr/share/squirrelmail/ for example attach - /usr/share/squirrelmail/attach

mkdir -p /usr/share/squirrelmail/attach

2) chmod 733 -R /usr/share/squirrelmail/attach
2) squirrelmail-configure
3) choose 4(General Options) and press Enter
4) choose 2(Attachment Directory) and paste ==>  /usr/share/squirrelmail/attach

press 'S' to save and exit
done !!

ispconfig 3 move spam to junk folder

http://www.geekonthepc.com/2012/01/23/configuring-anti-spam-spamassassin-in-ispconfig-3/

 ISPConfig relies on SpamAssassin – which is, when configured correctly, a very powerful spam filter. But for some reason, it just wasn’t working on my installation of ISPConfig. Spam would get through and it can get seriously frustrating!
Thankfully I now have it cracked – and wanted to share the configuration I chose for ISPConfig and SpamAssassin. I think the correct settings vary from person to person – but if you want general spam filtering, this should show you how to get it.

Instructions
First of all, make sure a ‘spamfilter’ policy is active both for the email domain you’re using and for each email mailbox. I chose the Uncensored policy in my case – but different rules apply to each setting. I found Uncensored to be most effective, but simply choosing this won’t make it work properly.
Once you’re happy that it’s supposedly on, you need to modify the rules for the policy you chose. Head to the ‘Email’ tab, and then from the left menu select ‘Policy’ under the ‘Spamfilter’ section (see screenshot that follows).
Select the policy you’re working with by simply clicking on it. Then select the ‘Tag-Level’ tab. This is where you set how sensitive SpamAssassin actually is. I found that the first three settings needed to be set as the following:
SPAM tag level: 3
SPAM tag2 level: 3.4
SPAM kill level: 5
The other settings requiring a number can be left alone. However, to make SPAM easier to separate, I’d suggest you turn on ‘SPAM modifies subject’ and choose a tag you’d like to add to SPAM emails. Here’s what the page might look like when you’re done (see screenshot that follows). 
Hit ‘Save’ and it’s a good’en. If you also want to move SPAM email to a seperate Junk folder, you can do so by going to the ‘Email Mailbox’ page from the left menu, then selecting your email account and clicking the ‘Mail Filter’ tab. Simply tick the ‘Move Spam Emails to Junk directory’ checkbox and dodgy email will be moved.
Hopefully that should get you going and stop infuriating SPAM emails reaching your inbox.

Table ‘./mysql/user’ is marked as crashed and should be repaired

How to make mysql service online from crash!

mysqld started

[ERROR] /usr/sbin/mysqld: Table ‘./mysql/user’ is marked as crashed and should be repaired
[ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘./mysql/user’ is marked as crashed and should be repaired mysqld ended

Which means DB: /var/lib/mysql/mysql table: “user” has been crashed.

To resolve this issue, please perform the commands below:

]# service mysql start --skip-grant-tables

now with mysql started, you can repair the mysql/user table

]# mysqlcheck -r mysql user

After that,

]# service mysql stop

]# service mysql start

OR

mysql> use mysql;

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

mysql> check table user;
+————+——-+———-+———————————————————-+
| Table | Op | Msg_type | Msg_text |
+————+——-+———-+———————————————————-+
| mysql.user | check | warning | Table is marked as crashed |
| mysql.user | check | warning | 6 clients are using or haven’t closed the table properly |
| mysql.user | check | error | Record at pos: 24992 is not remove-marked |
| mysql.user | check | error | record delete-link-chain corrupted |
| mysql.user | check | error | Corrupt |
+————+——-+———-+———————————————————-+
5 rows in set (0.02 sec)

mysql> repair table user;
+————+——–+———-+——————————————+
| Table | Op | Msg_type | Msg_text |
+————+——–+———-+——————————————+
| mysql.user | repair | warning | Number of rows changed from 1384 to 1385 |
| mysql.user | repair | status | OK |
+————+——–+———-+——————————————+
2 rows in set (0.48 sec)

mysql> check table user;
+————+——-+———-+———-+
| Table | Op | Msg_type | Msg_text |
+————+——-+———-+———-+
| mysql.user | check | status | OK |
+————+——-+———-+———-+
1 row in set (0.02 sec)

mysql>

#service mysql start

ssh port forward

29 April 2015
Port forwarding (tunneling), especially the local port forwarding, is a very handy feature of SSH. This blog explains local port forwarding in detail first. After that, this blog then introduces remote port forwarding and dynamic port forwarding briefly.

How local port forwarding works

Before getting started, let us assume we have the following three hosts and want to forward all traffics to port 80 of my pc to the port 8080 of target host.
local-port-forwarding-1.png
This is a case which SSH local port forwarding applies. The command to set the tunnel is:
ssh ssh_server -L 80:target:8080
This command set up a SSH connection between my PC and the SSH server. This connection, in addition to working as usual, also acts a tunnel.
local-port-forwarding-2.png
When traffics arrive at port 80 of my pc, they will then go through the tunnel.
local-port-forwarding-3.png

Jump three hops

Note that in fact a traffic can be originated from a forth machine. That is, you can "jump 3 hops" with a single SSH tunnel.
local-port-forwarding-4.png
According to man page, the listening port will, by default, be bond to the loop back interface only. To forward traffics from other machines, one must
  1. Set GatewayPorts in /etc/ssh/sshd_config to "yes".
  2. Specify bind address. For instance (empty or * for any), on ssh client run the following command:
    ssh -L :80:ssh_server:8080 target
    
But according to my test,
  1. GatewayPorts does not take effect.
  2. Remote port forward bind to all interface by default.

Option '-N'

Do not execute a remote command. This is useful for just forwarding ports (protocol version 2 only).

Remote Port Forwarding

As the name indicates, remote port forwarding is the reverse of local port forwarding. This time, the traffic arrives at the "remote" side will be forwarded to the host on local side.
ssh ssh_server -R :8888:target:8080
ssh ssh_server -R :8888:localhost:8080
remote-port-forwarding.png

Dynamic Port Forwarding

Yet another kind of port forwarding turns your local machine to a socket proxy. For instance, assume that your local machine locates behind firewall and all outgoing HTTP requests are filtered by the firewall. A way to circumvent this restriction is to set up an ssh server outside the firewall and employ the dynamic port forwarding technique.
  1. Run the following command to set up ssh tunnel.
    ssh ssh_server -D 8000
    
  2. Then, in web browser, set proxy as "SOCKS Host" localhost:8000.
Exercise: study the following picture and compare dynamic port forwarding with local port forwarding.
dynamic-port-forwarding.png

Check which mpm (multi processing module) apache is running prefork worker or mpm

In Ubuntu 14.04 apache2.4

a2query -M
 
Tells event, prefork, worker
You can change it by adding symbolic links for mpm_<chosen> from mods-available to mods-enabled in /etc/apache2.
Only one is allowed in a time.


#source /etc/apache2/envvars
#apache2 -V | grep -i "server mpm"

#httpd -V | grep -i "server mpm"



set environment or enviroment variable linux

https://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/


  1. /etc/environment This is the best place for variables that are system-wide. This includes extending variable PATH with paths from /usr/local or for JAVA_HOME Do not use export here or duplicate definitions. 
  2. /etc/xprofile Very little known but very useful for everyone who uses X window system. This is executed for every user that logs into X. It is very good choice for values that are valid for every user like /usr/local. Documentation.
  3. /etc/profile and /etc/profile.d/* This is a good choice for non X systems but bad for X ones. Those files are read only by shells.
  4. /etc/<shell>.<shell>rc. This is not a good choice because it is single shell specific. Also forget about X.
  5. ~/.xprofile The same as 2. This is executed when the user logs into X. The variables defined here are visible to every X application. A very good place for extending PATH with values such as ~/bin or ~/gocode/bin or defining user specific GOPATH. Your graphical text editor or IDE started by shortcut will see those values. Documentation.
  6. ~/.profile It will be visible only for programs started from terminal or terminal emulator. It is a good choice for systems where you do not use X window system.
  7. ~/.<shell>rc. This is not a good choice because it is single shell specific.

/bin/bash
       The bash executable
/etc/profile
       The systemwide initialization file, executed for login shells
~/.bash_profile
       The personal initialization file, executed for login shells
~/.bashrc
       The individual per-interactive-shell startup file
~/.bash_logout
       The individual login shell cleanup file, executed when a login shell exits
~/.inputrc
       Individual readline initialization file
 
If you have ever put something in a file like .bashrc and had it not work, or are confused by why there are so many different files — .bashrc, .bash_profile, .bash_login, .profile etc. — and what they do, this is for you.
The issue is that Bash sources from a different file based on what kind of shell it thinks it is in. For an “interactive non-login shell”, it reads .bashrc, but for an “interactive login shell” it reads from the first of .bash_profile, .bash_login and .profile (only). There is no sane reason why this should be so; it’s just historical. Follows in more detail.
For Bash, they work as follows. Read down the appropriate column. Executes A, then B, then C, etc. The B1, B2, B3 means it executes only the first of those files found.



 
 


setup git server ubuntu 14.04 lts

install git on both gitserver and client

ssh-copy-id the publickey from client to server
mkdir -p /files/webdir.git
cd /files/webdir.git
git init --bare
chown -R gituser:gituser /files/

##On client-A

git config --global user.name "Joe blog"
git config --global user.email "joe@example.com"

we create our local git repo on /developer/djangoproject

mkdir -p /developer/djangoproject
cd /developer/djangoproject
git init .
git remote add origin root@gitserver:/files/webdir.git

to edit >> git remote set-url origin root@gitserver:/files/webdir.git

echo "hello" > index.html
git add .
git commit -m "first commits"

git push origin master

    Counting objects: 3, done.
    Writing objects: 100% (3/3), 212 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To root@gitserver:/files/webdir.git
    * [new branch]      master -> master

   
### On client-B
git clone root@gitserver:/files/webdir.git OR
git clone root@192.168.100.221:/files/webdir.git




enable ssh root login linux

vim /etc/ssh/sshd_config

#PermitRootLogin without-password

PermitRootLogin yes

enable ssh password authentication

vim /etc/ssh/sshd_config
#place below at end of file

PasswordAuthentication yes

##Enable root login

vim /etc/ssh/sshd_config

#PermitRootLogin without-password
PermitRootLogin yes