Hi all. I don't know if this is possible, and if it is, whether it needs
to be done within Apache configuration or PHP configuration, but here goes:
I am migrating my web server to another machine. In fact, it is two
machines -- one for the web server itself, and one as a data server for
user home directories and MySQL.
The users' home dirs will be mounted on the web server as NFS mounts.
Now, the original, current, configuration has user home directories in
/home/*. There are a number of PHP scripts that refer to this directory
by an absolute path, for example, with lines like:
<? include("/home/webmaster/public_html/include/thing.inc"); ?>
However, the NFS mounted home directories are mounted on /webusers. This
is because I was reserving /home for actual local user directories.
Is there a way I can map calls to "/home" to "/webusers" without actually
changing all of the places that such absolute-path calls exist?
Note that a symbolic link from /home->/webusers wil not work because /home
is a real, existing, local directory.
System details:
old server: Red Hat Linux 9, Apache 1.3.x, PHP 4.3.x, MySQL 3.23.x
new server(s):
web: RHEL 4, Apache 2.0.x, PHP 4.3.x
data: RHEL 4, MySQL 4.1.x
I can post any more details as requested, of course.
Thanks!
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/ 10 2131
JDS wrote: Hi all. I don't know if this is possible, and if it is, whether it needs to be done within Apache configuration or PHP configuration, but here goes:
I am migrating my web server to another machine. In fact, it is two machines -- one for the web server itself, and one as a data server for user home directories and MySQL.
The users' home dirs will be mounted on the web server as NFS mounts.
Now, the original, current, configuration has user home directories in /home/*. There are a number of PHP scripts that refer to this directory by an absolute path, for example, with lines like:
<? include("/home/webmaster/public_html/include/thing.inc"); ?>
However, the NFS mounted home directories are mounted on /webusers. This is because I was reserving /home for actual local user directories.
Is there a way I can map calls to "/home" to "/webusers" without actually changing all of the places that such absolute-path calls exist?
Note that a symbolic link from /home->/webusers wil not work because /home is a real, existing, local directory.
The fastest solution I can think of would be to make symlinks for all users
located in /webusers to /home, this way you would get around the problem of
all absolute paths without modifying anything.
eg: ln -s /webusers/webmaster /home
of course this will lead to problems if there are two users with the same
directory name.
Best solution would of course to fix those hard coded paths, you could run
something like:
perl -npe 's/\/home\//\/webusers\//g' -i *
on each public_html and the subdirectories (sure there are people good at
writing a small script that you could use).
//Aho
On Fri, 04 Nov 2005 18:26:06 +0100, J.O. Aho wrote: The fastest solution I can think of would be to make symlinks for all users located in /webusers to /home, this way you would get around the problem of all absolute paths without modifying anything.
eg: ln -s /webusers/webmaster /home
Ah, of course. I'll try this for now.
something about this is not sitting quite right with me, though. Can;t
put my finger on it yet.
Thanks!
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
JDS wrote: On Fri, 04 Nov 2005 18:26:06 +0100, J.O. Aho wrote:
The fastest solution I can think of would be to make symlinks for all users located in /webusers to /home, this way you would get around the problem of all absolute paths without modifying anything.
eg: ln -s /webusers/webmaster /home
Ah, of course. I'll try this for now.
something about this is not sitting quite right with me, though. Can;t put my finger on it yet.
Could it be user john on the exported media and the user john on the importing
machine?
JDS wrote: Hi all. I don't know if this is possible, and if it is, whether it needs to be done within Apache configuration or PHP configuration, but here goes:
I am migrating my web server to another machine. In fact, it is two machines -- one for the web server itself, and one as a data server for user home directories and MySQL.
The users' home dirs will be mounted on the web server as NFS mounts.
Now, the original, current, configuration has user home directories in /home/*. There are a number of PHP scripts that refer to this directory by an absolute path, for example, with lines like:
<? include("/home/webmaster/public_html/include/thing.inc"); ?>
However, the NFS mounted home directories are mounted on /webusers. This is because I was reserving /home for actual local user directories.
Is there a way I can map calls to "/home" to "/webusers" without actually changing all of the places that such absolute-path calls exist?
Note that a symbolic link from /home->/webusers wil not work because /home is a real, existing, local directory.
System details: old server: Red Hat Linux 9, Apache 1.3.x, PHP 4.3.x, MySQL 3.23.x
new server(s): web: RHEL 4, Apache 2.0.x, PHP 4.3.x data: RHEL 4, MySQL 4.1.x
I can post any more details as requested, of course.
Thanks!
First of all, you should be using:
include ($_SERVER['DOCUMENT_ROOT']) . '/include/thing.inc');
Then if you change to another server or otherwise move your Apache
document_root you don't need to change all of your include statements.
As for the rest of the question, there's no way I can think of. And
Apache alias for the directory would not affect PHP include statements.
Since you can't create the symlink I think you're stuck with changing
all of your include statements.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
On Fri, 04 Nov 2005 14:40:45 -0500, Jerry Stuckle wrote: First of all, you should be using:
include ($_SERVER['DOCUMENT_ROOT']) . '/include/thing.inc');
Then if you change to another server or otherwise move your Apache document_root you don't need to change all of your include statements.
As for the rest of the question, there's no way I can think of. And Apache alias for the directory would not affect PHP include statements.
Since you can't create the symlink I think you're stuck with changing all of your include statements.
Thanks. "Should be" is not really possible because this machine has
scripts written over the past five years, by several different
individuals, with extremely loose enforcement of coding style. Too late
to change that.
Here is what I did:
* symlinks to each user in /webusers to /home (as suggested by Aho)
* am enforcing a policy whereby local users home directories are called
"/home/username-local" so that there is no name squashing going on by
mistake
shouldn't matter too much -- there are not going to be more than one or
two local user on the apache box anyways. user data is all on the data box.
Thanks for any and al help, o' Usenet denizens.
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
JDS wrote: shouldn't matter too much -- there are not going to be more than one or two local user on the apache box anyways. user data is all on the data box.
If there is only a couple of local users, then maybe it had been easier to do
the other way around, having the local users say in /users and mount the nfs
export to /home.
//Aho
On Sat, 05 Nov 2005 00:07:09 +0100, J.O. Aho wrote: If there is only a couple of local users, then maybe it had been easier to do the other way around, having the local users say in /users and mount the nfs export to /home.
Yes, I had considered this.
Well, the thing ain't fully configured and certainly isn't live yet, so I
just may do this.
I wonder if there is a way to make "/whatever_directory" the default
home directory for users created with "useradd". I'll have to look into
this...
--
JDS | je*****@go.away.com
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
>> If there is only a couple of local users, then maybe it had been easier to do the other way around, having the local users say in /users and mount the nfs export to /home.
Yes, I had considered this.
Well, the thing ain't fully configured and certainly isn't live yet, so I just may do this.
I wonder if there is a way to make "/whatever_directory" the default home directory for users created with "useradd". I'll have to look into this...
On at least some flavor of Linux, the -D option can be used to
change the defaults (permanently) for various things like home
directory, shell, and group. This information seems to be kept in
/etc/login.defs.
Gordon L. Burditt
On Fri, 04 Nov 2005 11:06:58 -0500, JDS wrote: I am migrating my web server to another machine. In fact, it is two machines -- one for the web server itself, and one as a data server for user home directories and MySQL.
The users' home dirs will be mounted on the web server as NFS mounts.
In the interest of closure, I have done/am doing the following (tersely
stated):
mv /home /home-local
useradd -Db /home-local
results of `grep home /etc/fstab`:
data.server.edu:/home /home nfs defaults 1 2
later...
--
JDS | je*****@example.invalid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: steve |
last post by:
I am having huge problems migrating large db’s from one server to
another. I use phpmyadmin to dump the data into a file, and then
migrate it to my production server. Then I try to use this:...
|
by: Serdar Yegulalp |
last post by:
I'm in the process of migrating a lot of data (millions of rows, 4GB+
of data) from an older SQL Server 7.0 database to a new SQL Server
2000 machine.
Time is not of the essence; my main concern...
|
by: Wolfgang Bachmann |
last post by:
We migrated a database from Version 5.1 to 8.1 and are experiencing
massive locking problems. We migrated in the following steps:
0) Server 5.2, Clients 5.2: everithing was fine
1) Server 5.2,...
|
by: Mike Towers |
last post by:
Hi,
The company I work for has a web site (IIS5) build using ASP and COM+
components which are written in VB6 and provide the business and database
logic for the site.
We would very much like...
|
by: BobRoyAce |
last post by:
I would really appreciate recommendations for sources of materials on
migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there a
magazine that is particularly good for .NET stuff....
|
by: bh |
last post by:
I had a machine with VS2003 & Win2K adv. server, which crashed. I have a
new one with WinXP, and I loaded VS2003 (Dev Ed) and some existing
projects...
When I tried to open any projects, at...
|
by: Don Rich |
last post by:
Please share with me any ideas you may have for troubleshooting and resolving
the subject problem. I can give more details as necessary. (Please advise
if I should post this problem to a more...
|
by: Matt Fielder |
last post by:
First off, if this is better posted in another group that qualifies as a
manged group, please let me know.
I currently have an application written in VB.Net using MSDE as the
database. Current...
|
by: Alex |
last post by:
Hi,
Probably a simple question :-)
I've got a few xml aware databases on a 9.1.2 db2 server running on
RHEL 4. As db2 V9.5 doesn't run on RHEL 4 I've set up a new server
running RHEL5.1 with...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |