(Solved) LaMP stack and local www services issues

hakerdefo

#15
'httpd.conf' and/or 'hosts' files can be worth looking into.
You Can't Always Git What You Want

statmonkey

Quote from: hakerdefo on April 22, 2014, 11:23:15 AM
'httpd.conf' and/or 'hosts' files can be worth looking into.

Yep. Just coming to post that. Thanks hakerdefo!

VastOne

#17
Got this solved and it was a dandy one...

Here is why it happened... when downloading the database from my hosting site to restore to this server, the very first thing I must do is change the IP from the online server to the localhost so that the themes will work... it is a simple process and one I do every time I do a reinstall locally to bring this test site up to this forums levels

The way the changes are made uses the IP address and I knew this but did not recall it because every time I reset it all I have to do is click a reset button and it is done...   I had to go into the database and scrub the old IP away before I could access it at all.  These are the correct settings

Theme directory (templates):    /var/www/Themes/darkmodern2
URL to above directory:    http://24.50.134.254:9669/Themes/darkmodern2
URL to images directory:    http://24.50.134.254:9669/Themes/darkmodern2/images

So in the end it was a theme setting that was holding onto the old IP address ... it has now been corrected

Thanks to statmonkey for all your help and diligence and thanks to aibo on the IRC who reminded me just how powerful curl is and in helping me trace down the issue

Closed and my migraine is now gone too

http://vsido.no-ip.biz

:D


VSIDO      VSIDO Change Blog    

    I dev VSIDO

hakerdefo

That's a great detective work!
It was fascinating to watch VastOne and statmonkey go all gun blazings to solve this one! A great thread!
Cheers!!!
You Can't Always Git What You Want

VastOne

^ It was fun... jedi on the IRC and then aibo had their guns hot and blazing as well... it was a good one to chase down

Thanks mate...

One query... is httpd.conf even still used by apache?  I searched for it on my local server and did not find it.. I thought that it might be how older versions of apache worked
VSIDO      VSIDO Change Blog    

    I dev VSIDO

statmonkey

Impressive work VastOne, I am embarrassed to say that I rarely use curl and probably rely on grep too much.  Once you said you had grepped for the offending IP my brain closed that avenue or my bias most likely.  Hat tip to aibo for the reminder and will now accept my 100 curl commands as a reminder/penance.  Glad you got it solved. 

Not sure about httpd.conf they have changed so many things and I need to brush up before my next disaster. :)

VastOne

#21
^Thanks man! It was damn fun... though I lost some more hair I am sure...

I am adding the conversation that aibo and I had on the IRC so that anyone who may run into this in the future can learn from it

I love this line from aibo

"how can a machine even run without curl installed"

Quote<aibo> just red about your home server issue
<VastOne> pain in the arse
<aibo> have you fixed it yet?
<VastOne> oe
<VastOne> no
<aibo> actually i can load the page
<aibo> but it takes a lot of time with firefox
<VastOne> well I just rebooted and have not tested the new change I just made
<VastOne> Yar
<VastOne> that is what I am seeing
<VastOne> a long long time and it loads
<aibo> curl shows the sources right away
<aibo> and there are some references to the old ip
<aibo> images and stuff
<VastOne> right
<aibo> that's why firefox takes long time
<aibo> and curl not
<VastOne> you are seeing exactly what I see
<VastOne> when I try to access it even from localhost
* V-Ger` is now known as V-Ger
<VastOne> http://localhost
<VastOne> it seems an internal apache setting
<VastOne> but for the life of me I cannot locate it
<aibo> hm, so the ip is not in the html/php source code?
<aibo> seems strannge, baecause new and old ip is used in urls
<VastOne> right
<VastOne> the new IP is there from the webdirect coming from no-ip
<VastOne> and that configuration is confirmed and good
<aibo> it's in the html
<VastOne> but when it hits my side of the router, it is looking for the old IP
<aibo> well, since I am able to load the page it apparently reaches the right server and the webserver running on the new ip
<VastOne> there is a way to rerun the local web setup
<VastOne> I can see it's config but it does not show the old IP
<VastOne> I can rerun just to eliminate http as the issue
<aibo> http is fine
<aibo> forwarding is fine
<VastOne> right
<aibo> or is a webserver still running on the old ip?
<aibo> i guess the old ip isn't active at all right now, right?
<VastOne> no, it is completely gone from anything I have setup
<VastOne> afaik
<aibo> :D
<VastOne> :D
<aibo> so I have to conclude that forwarding is working and http as well, as i can fetch the page with curl
<aibo> curl http://24.50.134.254:9669/ 2>/dev/null | grep 24.50.131.104
<V-Ger> Title: VSIDO Community - Index (at 24.50.134.254:9669)
<aibo> lol, thx V-Ger
<aibo> this shows me a lot of lines with reerences to the old ip
<aibo> so the issue has to be in the php/html sources of the page
<VastOne> I am not totally sure... after the long time out searching for 24.50.134.254 and the shell page does in fact show up, it continues to look for the old ip from the browser
<VastOne> ok
<VastOne> let me rerun the setup of the php/html
<aibo> yeah, since i don't know nothing about the structure of the sources I can't help with this, I'm afraid
<VastOne> It is smf and is quite good for resetting
<aibo> or are they viewable online somewhere?
<VastOne> and actual php that does all the work for me
<VastOne> I cannot access anything locally on this machine
<VastOne> localhost or 127.0.0.1
<aibo> do you have iptables rules configured on this machine?
<VastOne> not to my knowledge... meaning it has never been done by me
<VastOne> or...
<VastOne> I have and have forgotten tit
<VastOne> :D
<aibo> :D
<aibo> so what do you receive with curl -i localhost?
<aibo> does it timeout?
<VastOne> one sec
<aibo> or an instant error or something?
<aibo> or a 404
<VastOne> installing curl on that server... thats how vanilla it is
<aibo> :D
<aibo> whaaaat
<VastOne> hehe
<aibo> how can a machine even run without curl installed
<VastOne> surprisingly well
<VastOne> I got instant feedback from curl
<VastOne> like you the old ip is all through it
<VastOne> I need to access the repair tool to fix it
<VastOne> but anything I try to get to that tool (php file via a browser) does not let me access it
<aibo> i gues the configs are saved in the http document root somewhere
<aibo> just edit the textfiles
<VastOne> Thats just it... int he Settings.php, it is not there
<VastOne> that IP I mena
<VastOne> mean
<aibo> hm, is it saved in the database?
<aibo> just change it there
<VastOne> in the database now
<aibo> i guess you have grepped the whole machine for the the old ip address 1001 times by now? :D
<VastOne> Yes
<VastOne> and never found it in a config file
<aibo> have you found something in the db, VastOne?
<VastOne> not yet
<VastOne> still looking
<VastOne> using phpadmin and it is clunky
<aibo> hm, mysql has a usable cli
<VastOne> Yar
<aibo> not as nice as the postgresql cli tho
<aibo> VastOne: it seems the occurences of the old ip are related to the theme "darkmodern2"
<VastOne> right
<VastOne> curl shows that
<aibo> yeah
<VastOne> that is the default theme
<aibo> ok, it sometimes calls /Themes/default and sometimes Themes/darkmodern2
<aibo> seems it's in the javscript
<aibo> smf_theme_url and smf_images_url should be set somewhere
<aibo> I'd grep for these in the document root for the website VastOne
<VastOne> will do
<aibo> or whereever the smf configs are stored
<VastOne> try accessing now aibo
<VastOne> I found it in the database in the themes
<VastOne> and used php myadmin to eliminate it
<VastOne> the them is wrong but at least I can now access it
<VastOne> the theme
<VastOne> got it all corrected aibo ... and thanks to you and curl you got me on the correct path
<VastOne> I appreciate it!
<VastOne> I also see now why it happened
<djt> i've just been reading through (most of) that thread and chat regarding your ip lamp issue...   all fixed?  for a mo i thought it might be a nameserver issue just needing to wait to update.
<VastOne> Yes it is fixed and I am writing now what the issue was on the forum to close it out
<djt> :)
<aibo> great to hear you solved it VastOne :)
<VastOne> thanks to you and your insights... I really appreciate it aibo
<VastOne> that was a damned good one
<VastOne> damned easy button fix (from smf admin toolset) is there for a good reason... but when an ip changes, it made it nasty
VSIDO      VSIDO Change Blog    

    I dev VSIDO

statmonkey

Thanks for posting your work through very ... (quickly makes sure curl is installed) ... interesting :)

hakerdefo

#23
Quote from: VastOne on April 22, 2014, 05:24:35 PM
One query... is httpd.conf even still used by apache?  I searched for it on my local server and did not find it.. I thought that it might be how older versions of apache worked
My mistake! Apache2 in Debian doesn't have 'httpd.conf' file. It is deprecated. On some  distros this file is there but it is empty. It can still be used (not advised) because Apache2's newer and now default main config file '/etc/apache2/apache2.conf' includes the magical line, 'Include httpd.conf'.
It is advised to do any user configuration in the configuration file in '/etc/apache2/conf.d/ ' directory.
Cheers!!!
You Can't Always Git What You Want