Backgrounds:
I’m deploying several (about 10) wordpress sites in a single ubuntu-server.
For each, I have a single mysql database (single schema), and a single wordpress file directories.
For each instance of wordpress directories, the structure is like the below:
|-- wp-admin
| |-- css
| |-- images
| |-- includes
| |-- js
| |-- maint
| |-- meta
| |-- network
| `-- user
|-- wp-content
| |-- cache
| |-- languages
| |-- plugins
| |-- themes
| |-- upgrade
| `-- uploads
`-- wp-includes
|-- certificates
|-- css
|-- fonts
|-- ID3
|-- images
|-- js
|-- pomo
|-- SimplePie
|-- Text
`-- theme-compat
So I found that the wp-admin
and wp-content
directories is redundant, because they’re wordpress core part, I will never change them manually.
To reduce the space of these parts, I keep one instance, and for the others, I created symbolic links on them.
For example, I have one base instance first:
/var/www/wordpress/
And one of mysite:
/var/www/site1/
I change the structure using these commands:
$ cd /var/www/site1
$ rm -rf wp-admin
$ rm -rf wp-includes
$ ln -s /var/www/wordpress/wp-admin ./
$ ln -s /var/www/wordpress/wp-includes ./
Well, I run the site1
, it effects.
Problem:
After this, I’m not able to enter the admin panel.
When I navigate to: http://mysite.mydomain.com
.
It redirect to the login page, and no matter what I was entering (I can make sure the username and password are correct), it cannot login.
It seems the session cannot create correctly, can anyone point out what’s the matter here?
Please help, thank you.
Try mounting the folders instead of using symbolic link. Something similar to this
make sure you have the directory created before you mount. If this works for you then make sure you have the mount in your /etc/fstab
Addition to @madmanali93’s answer, we can add a record to
/etc/fstab
to auto mount that directory on boot: