discuss "local wordpress installation"

Discuss a HowTo.

Moderator: How-to Curator

discuss "local wordpress installation"

Postby nadir » August 23rd, 2011, 11:11 am

from here:
viewtopic.php?f=9&t=1226

No need to mention that its a result of what i have asked and been told here, in the forum.
As far i see cgi-bin apps and other mysql/php apps would fit in the discussion too
(from the ones i have tested drupal seems very powerful, but not as easy, and serendipity might be a good choice too. In case wordpress simply is not your thing, for what reason ever).

All you really need is the short summary at the bottom, and then fiddle and google a bit.
nadir
 
Posts: 1708
Joined: February 9th, 2011, 8:07 am

Re: discuss "local wordpress installation"

Postby mharrison » October 15th, 2011, 1:58 am

Ok, so I followed everything, and it all works great from the server. I cannot, however, access anything but the index.html file that resides in /var/www/ from any other machine on my network. Been googling but all of the results I have been finding are for apache running in Windows and that frankly does me no good. Any ideas?
mharrison
 
Posts: 1081
Joined: February 13th, 2011, 5:39 pm

Re: discuss "local wordpress installation"

Postby nadir » October 15th, 2011, 7:25 am

From the top of my head, a shot in the dark:
Did you do something similar to "cp /etc/wordpress/config-localhost.php /etc/wordpress/config-192.168.1.3"
assuming the IP of the server is like that?
nadir
 
Posts: 1708
Joined: February 9th, 2011, 8:07 am

Re: discuss "local wordpress installation"

Postby mharrison » October 15th, 2011, 11:08 am

nadir wrote:From the top of my head, a shot in the dark:
Did you do something similar to "cp /etc/wordpress/config-localhost.php /etc/wordpress/config-192.168.1.3"
assuming the IP of the server is like that?



I didn't do anything like that. I did try it but it didn't change anything other than screwing things up on the server itself. I'm purging and reinstalling right now. When I can I will get the text of the error message. It was late when I was doing all of this so I didn't think to write it down then.
mharrison
 
Posts: 1081
Joined: February 13th, 2011, 5:39 pm

Re: discuss "local wordpress installation"

Postby CiaW » October 15th, 2011, 9:05 pm

I wanted to be able to access one of my virtual hosts from my laptop, to the local desktop server. But I didn't want to open port 80 on my firewall, and when I tried to use a different port it just didn't work, even though I changed it in the ports.conf file. Then I finally found an article that showed that one can have more than 1 'listen' port directive in the ports.conf and virtual host files. Here's the link to the article (I have a web setup file where I throw some of this info for later reference):
‭http://www.freebsdmadeeasy.com/tutorials/web-server/configure-apache-web-server-on-freebsd.php

So now my /etc/apache2/ports.conf has this:
NameVirtualHost *:80
Listen 80
Listen nnnn
Listen nnnn
(And nnnn = some port number you want to use.) Check the /etc/services file to see which ports aren't already alloted for other things, if you want. Here's an example for one of the virtual hosts config file, for the host that I want to access as my 'intranet'. I also added an alias that makes it a bit easier than typing the full http://192.168.0.10:nnnn to bring up the page. If someone knows of a better way please advise, but I did a lot of searching before I found this and got it to work.

Code: Select all
<VirtualHost *:nnnn>
    ServerAdmin cia@localdomain
    DocumentRoot /var/www/mynet
    ServerName 192.168.0.10:nnnn
   ServerAlias  mynet
    ErrorLog ${APACHE_LOG_DIR}/mynet-error_log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
   LogLevel warn
   CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/mynet>
Options Indexes Includes FollowSymLinks
AllowOverride None
Allow from 127.0.0.0/255.0.0.0 ::1/128 192.168.0.0/255.255.255.0
Order allow,deny
</Directory>
Alias /cianet/ "/var/www/mynet/"
    <Directory "/var/www/mynet/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128 192.168.0.0/255.255.255.0
    </Directory>

After making those changes, you'll want to restart apache2. And I opened port nnnn on my server's firewall. While it's not specific to Wordpress, it's the same principle.

Edit-- I just re-read the original saying you could only access index.html from the other machine, and this was when I couldn't access anything. It may be you'll want to add the following to your httpd.conf file (or the apache2.conf file), so it'll pull up a php before an html, which is what I also had to do:
Code: Select all
DirectoryIndex index.php index.html index.html.var
CiaW
 
Posts: 364
Joined: June 26th, 2011, 4:42 pm

Re: discuss "local wordpress installation"

Postby mharrison » October 16th, 2011, 12:02 am

This is the error message that I am getting

Code: Select all
Neither /etc/wordpress/config-192.168.1.2.php nor /etc/wordpress/config-168.1.2.php could be found.
Ensure one of them exists, is readable by the webserver and contains the right password/username.


I tried adding the DirectoryIndex to both httpd.conf and apache2.conf and restarted apache but that didn't make any difference.


Edit...

I installed Serendipity and ran
Code: Select all
ln -s /usr/share/serendipity /var/www/


and I can access it from all other computers on my network....it appears this issue is isolated to something with the config for Wordpress, just what is the question I am banging my head against the desk about.
mharrison
 
Posts: 1081
Joined: February 13th, 2011, 5:39 pm

Re: discuss "local wordpress installation"

Postby nadir » October 16th, 2011, 2:02 pm

I recall that i had problems to reach wordpress from the WAN.
I don't recall i had problems with addresses in the LAN.
I had to cp /etw/wordpress/config-locahlhost.php.
Strange enough i got: config-192.168.1.89.php and config-dyndns.info.php, both being identical to config-localhost.php
If i can't recall it does not mean that nothing happened, perhaps i am wrong

What i did also was to edit:
-> login the web-interface -> settings -> "Wordpress address (URL)" and "Site address (URL)"
but i am quite sure that was neccessary to forward to the WAN.

Did you run something like:
Code: Select all
bash /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

As far i see, yes, you did, else it would not open at all. Still it was a part i overlooked more than once.

Funny enough i had problems with serendipity, and as the most easy way out i picked wordpress instead.
Not sure if that is a solution for you (as you were the one who recommended serendipity to me i guess it is a way out)

This link is quite clear, as far it's me:
https://help.ubuntu.com/community/WordPress

PS: scuttle was very easy to me. Install, ln to /var/www, done. Wordpress was a bit of a hassle too.

I am a bit confused, if this post is pointless, just ignore. :-)
nadir
 
Posts: 1708
Joined: February 9th, 2011, 8:07 am

Re: discuss "local wordpress installation"

Postby mharrison » October 17th, 2011, 12:49 am

There I fixed it.

I ran
Code: Select all
ln -s /etc/wordpress/config-localhost.php /etc/wordpress/config-192.168.1.2.php


Now it works.
mharrison
 
Posts: 1081
Joined: February 13th, 2011, 5:39 pm

Re: discuss "local wordpress installation"

Postby jheaton5 » August 8th, 2014, 1:00 pm

I did this successfully several years ago on server1. Then about 2 years ago I migrated the blog to server2. Naturally, because I'm stupid, I did not document how I did it. Now I want to migrate back to server1. It seems more complicated now that before. I am stuck reading all the instructions available. I have tried nadir's method, no joy. Now I am trying the Wordpress - Debian Wiki site. I tried the standard method beginning at the top of the page. I tried several times, purging and reinstalling between each try, no joy. Now I am using the 'Alternate Installation Method'. In this method the reader is directed to the /usr/share/doc/wordpress/README.Debian file:
More: show
#### Quick setup

Setup apache to point to /usr/share/wordpress. See the examples/apache.conf

Database and filesystem setup can be done with the help of a script in
examples/setup-mysql. Beware: it assumes that you want to install your
files in /srv/www/.

#### WordPress configuration file

The Debian package installs a wp-config.php script that will
try to load the real configuration from /etc/wordpress/config-$HOST.php
or /etc/wordpress/config-$DOMAIN.php (if the URL is "http://blog.example.com",
$HOST will be "blog.example.com" and $DOMAIN will be "example.com").

If none of those files exist, it will try /etc/wordpress/config-default.php.
Failing that, it will return an error 404.

This was initially developed to host multiple blogs on the same server
but since then, WordPress has grown a "multisite" feature of its own.

If you want to learn more about those configuration files, you should
check /usr/share/wordpress/wp-config-sample.php and
http://codex.wordpress.org/Editing_wp-config.php

#### Managing plugins, themes and uploaded files

To respect the FHS and to to let you add supplementary plugins and themes,
the default configuration sets WP_CONTENT_DIR to
/var/lib/wordpress/wp-content. This implies that your Apache configuration
should override the default wp-content directory (within the DocumentRoot)
with this directory. You can do this with an alias directive:
Alias /wp-content /var/lib/wordpress/wp-content

The subdirectories "uploads" and "blogs.dir" should be owned by www-data
by default. This ensures that you can upload media files from within
WordPress.

The subdirectories "uploads" and "blogs.dir" should be owned by www-data
by default. This ensures that you can upload media files from within
WordPress.

The subdirectories "themes" and "plugins" are where you can drop
non-packaged themes and plugins.

Note that if you want WordPress to be able to edit themes and to update
plugins, you have to ensure that all the themes and plugins are owned
by the webserver user (www-data). This is easy to do for the themes
and plugins that you have installed in /var/lib/wordpress/wp-content/:
$ sudo chown -R www-data /var/lib/wordpress/wp-content

But the default themes and plugins (installed in
/usr/share/wordpress/wp-content/) are owned by the root user. If you want
those to be editable, you should remove the corresponding symlink in
/var/lib/wordpress/wp-content/ and put there a full copy of the default
themes and plugins. Then you should re-run the previous chown command.

If despite all this, you can't get the plugin upgrade feature to work, you
can try to add the following parameter to your configuration file:
define( 'FS_METHOD', 'direct' );

#### Hosting multiple blogs

## With WordPress multisite

With WordPress multisite, you have a single instance of WordPress
(one database, one configuration file) that is able to manage multiple
blogs.

It is thus recommended to put your WordPress configuration in
/etc/wordpress/config-default.php. Then you should enable the
"Multisite" feature in the web interface directly through
Administration > Tools > Network Setup.

More information:
http://codex.wordpress.org/Create_A_Network

Note that the default configuration of the Debian package already includes
WP_ALLOW_MULTISITE set to true.

## With separate configurations

If you don't want to use the multisite feature, you can create
multiple configuration files corresponding to your various blogs.
Each configuration file can point to a dedicated MySQL database (or
they can share the same database but then they must use different
$table_prefix to ensure that they use different tables within
the same database).

#### Upgrading to a new Wordpress version

The package upgrade doesn't automatically update the Wordpress database,
you have to login to the administration page of your Wordpress instance
to complete this part of the upgrade.

Until you do this, your website might be broken and inaccessible. This is
only required when you switched to a new major release (like 3.4 → 3.5)
not when you installed a new minor version (like 3.5.1 → 3.5.2).

Now I'm going back to nadir's method and try some of your suggestions above. Thanks.
jheaton5
 
Posts: 1776
Joined: February 9th, 2011, 10:25 am
Location: Newnan, GA USA

Re: discuss "local wordpress installation"

Postby jheaton5 » August 11th, 2014, 4:15 pm

I have a successful install. I got the WP default install screen which spawned the login screen. I can get to the login screen anytime I want. But when I login I get a blank screen. I have a user name in mysql as username@host. Anyone have any ideas. A web search suggests setting PHP safe mode off. I can't figure how to do that.
jheaton5
 
Posts: 1776
Joined: February 9th, 2011, 10:25 am
Location: Newnan, GA USA

Next

Return to HowTo Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x