|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Which order to install ports?
Hi, I have an old Pentium 75Mhz computer with 32Mb of ram. It's running FreeBSD 4.3 and what I want to do is install Apache, PHP, and MySQL from the ports. Is there a certain order that I need to run make install for them so that they work together? I'm mainly setting this up to test scripts that I make on my home network, which consists of 2 windows boxes and the BSD box. Thanks! Also, freebsd, if you see this, or if anyone else can help me, this is my other question:
What I wanted to do was set this up so it's like a little webhosting type thing on my network, before, I had apache working without php and mysql and all I had to do was type in the ip address of the bsd machine, which my router gave out, into internet explorer on one of the windows boxes and it gave the contents of /usr/local/apache/htdocs. I wanted to setup something where I have it like 192.168.1.1/myname show the contents of /home/myname/www, but freebsd said that I should type in the hostname instead. I'm just wondering if anyone could explain this a little more indepth. He said something about editing the /etc/hosts file. Thanks for all your help everyone, and freebsd!
__________________
-MattWil |
|
#2
|
|||
|
|||
|
Hey it's me again. Let me explain a little more in details here.
>> I wanted to setup something where I have it like 192.168.1.1/myname 192.168.1.1/myname is not a FQHN. A fully-qualified hostname is like subdomain.domain.com. Though, Apache doesn't require that. That's why you can access some sites via http://www.linuxtoday.com AND http://linuxtoday.com. Should www.linuxtoday.com and without the www have the same content, both should point to the same IP address, and this MUST be done via DNS server before you can configure Apache like so: ServerName www.linuxtoday.com ServerAlias linuxtoday.com In your case, you want to use myname1 or perhaps myname2 and myname3, and each site should have different content. As mentioned earlier, myname is not a FQHN, therefore, it's not lookup'able via DNS. Since you are doing this for internal network, you can take advantage of /etc/hosts and C:\Windows\Hosts and c:\WinNT\system32\drivers\etc\hosts. The format of hosts file is straight forward and the same for UNIX and Windows: 192.168.1.1 myname1 myname2 myname3 Just ONE line. Since you are running Apache on just your FreeBSD box, so setting this is incorrect: 192.168.1.1 myname1 # freebsd box 192.168.1.2 myname2 # windows box just because myname2 should be resolvable to 192.168.1.1. With hosts file properly configured, you can then proceed to configure vhost in Apache. Example: <Directory "/home/*/www"> Options All AllowOverride All </Directory> NameVirtualHost 192.168.1.1 <VirtualHost 192.168.1.1> DocumentRoot "/usr/local/apache/htdocs" ServerName myname1 #default host ... ... </VirtualHost> <VirtualHost 192.168.1.1> DocumentRoot "/home/myname2/www" ServerName myname2 .. ... </VirtualHost> Say you have an foo.html file at /home/myname2/www/foo.html, you can then reach it via http://myname2/foo.html >> what I want to do is install Apache, PHP, and MySQL from the ports Install MySQL first, then Apache, then PHP. Last edited by freebsd : September 23rd, 2001 at 10:40 PM. |
|
#3
|
|||
|
|||
|
Ok, I totally reinstalled FreeBSD 4.3 so I could start off clean and start over. I then typed in "cd /usr/ports/databases/mysql323-server;make install" and this is the error it gives me:
Quote:
I tried more than just mercury, I tried mercury@domain and mercury.domain for the hostname, none worked. If anyone could help me with this it would be greatly appreciated! |
|
#4
|
|||
|
|||
|
Since I couldn't get mysql to install, I tried just installing apache to see if that worked and it all installed ok, but then when I try and start it I get an error about not having the servername specified, and then it says httpd could not be started. I went into the httpd.conf file and stuck in the line ServerName mercury and it took away the hostname error. I still get the httpd could not be started error though. Also, another question, I have two user accounts other than root and I put them into a group called admin. How do I make it so that I can use the su command with them? Right now it says I don't have access to the command. Thanks!
|
|
#5
|
|||
|
|||
|
Also, you were talking about the C:/Windows/Hosts folder, I don't have that on my machine. I'm running Windows ME. Any help there would be appreciated also.
|
|
#6
|
|||
|
|||
|
>> I then typed in "cd /usr/ports/databases/mysql323-server
There are at least 100 essential steps you first should configure before installing anything from the ports tree or precompiled binary. >> I tried mercury@domain and mercury.domain for the hostname You need to set a FQHN in /etc/rc.conf. Example: hostname="mercury.mylocaldomain.com" >> you were talking about the C:/Windows/Hosts folder No, I said file, not folder. Hosts file doesn't exist by default, so create it manually. >> I'm running Windows ME Check this: Win9x - C:\Windows\Hosts WinME - C:\Windows\Hosts WinNT - C:\WinNT\System32\Drivers\etc\Hosts Win2K - C:\WinNT\System32\Drivers\etc\Hosts WinXP - C:\WinNT\System32\Drivers\etc\Hosts Linux/UNIX/*BSDs - /etc/hosts (case sensitive) >> How do I make it so that I can use the su command with them? 1) vi /etc/group 2) Check for the line wheel:*:0:root 3) Append the usernames after root with comma as the delimiter like so: wheel:*:0:root,mercury,myfriend |
|
#7
|
|||||||
|
|||||||
|
Quote:
Sorry, didn't know that, is there a place that talks about what I need to configure? Quote:
Well, I just used the workgroup that's on my windows machine, the only thing I have with a .com is what @home game me, machinename.something1.az.home.com. This just takes me to my router. I've heard of ipchains, does that have anything to do with that? Also, sorry for this question again, if I bought a domain name, since I only have one IP, would I use @home's nameservers that they gave me? How would I do that? Or would I have to get another IP? Quote:
Sorry, I missed that, thanks :O) Quote:
Thank you very much for that, I'll remember that for if I use this with any other system. Quote:
Yes, it works, thank you very much! One more question, where did you learn all this? Just playing around? Do you have a job that works with *nix boxes? Thanks again! |
|
#8
|
|||
|
|||
|
>> is there a place that talks about what I need to configure?
In general, yes, almost everywhere like FreeBSD handbook, you should search google.com and check out as many BSD sites as possible. Keep in mind, FreeBSD is in no way better than NetBSD and OpenBSD in all cases. NetBSD has better documentation on their site. OpenBSD has man 8 afterboot (check this out). >> the only thing I have with a .com is what @home game me, machinename.something1.az.home.com You don't even need that. You should set a host name on Windows and put the same localdomain.com that you set on FreeBSD. >> I've heard of ipchains, does that have anything to do with that? Not at all. >> if I bought a domain name, since I only have one IP, would I use @home's nameservers that they gave me? Check out this thread -> http://forums.devshed.com/showthrea...2650&forumid=15 and find out what is DNS cache and Authoritative DNS server. The nameservers that you see normally by doing whois lookup doesn't mean they are DNS cache-aware, but they definitely should be Authoritative DNS nameservers. Say I have 4 IPs: (12.34.56.1-4) I can run authoritative DNS server on 12.34.56.1 and 12.34.56.2 and run cache-only on 12.34.56.3 and 12.34.56.4. In this setup, what you would see in whois are 12.34.56.1 and 12.34.56.2. What I would configure the nameservers in /etc/resolv.conf are 12.34.56.3 and 12.34.56.4. >> Or would I have to get another IP? Always get as many as you can handle. I currently have 4 for home-use but barely enough. If you are really into this stuff, don't join any DSL/cable with dynamic IPs. >> where did you learn all this? Hehe. jdk once asked me this. What I can tell is: search google.com. >> Do you have a job that works with *nix boxes? I do run my own business (network consultants) with 3 other patners. We are specializing in BSD systems and we do anything that has something to do with computers and Internet. You know, the technology is growing so fast and nobody in the world can keep up with the fast pace and calling themselves an expert. There still are way too many technologies I don't have any clue. That's why we are targeting on small businesses and we are more than capable to handle most of their needs. You might wonder what do I do with my spare time. I've been playing around with LDAP (one of my daily tasks) for over a year and creating web-interface applications like webmail and control panel (for my technical illiterate clients). |
|
#9
|
|||
|
|||
|
Thanks for all your help freebsd (for now :O), I'll probably ask for more later!). I changed my hostname to mercury.domain.com and then ran "cd /usr/ports/databases/mysql323-server;make install clean". That worked! Then "cd /usr/ports/www/apache13;make install clean". That worked! And now it's installing apache. Again, I thank you for all your help.
|
|
#10
|
|||
|
|||
|
Ok, I finally get what you are talking about with the c:\windows\hosts file. I have a c:\windows\hosts.sam file and it shows "127.0.0.1 localhost". I added the line "192.168.1.100 mercury". Then I restarted (not sure if I had to do that) When I type in mercury it just assumes I meant mercury.com I guess and goes to the Mercury Car site. I did just type http://mercury. In my httpd.conf file I have ServerName mercury. I'm not sure what else to do though. Thanks :O)
|
|
#11
|
|||
|
|||
|
>> I have a c:\windows\hosts.sam file
The sam refers to SAMPLE. >> I added the line "192.168.1.100 mercury" You should append your localdomain as well like so: 127.0.0.1 localhost 192.168.1.100 mercury.localdomain.com mecury >> When I type in mercury it just assumes I meant mercury.com Technically, that's a bug and violates RFC standard. Practically, that's a feature of your browser for auto-completion of domain name. >> I did just type http://mercury You should type http://mecury.localdomain.com or whatever localdomain you are using. >> In my httpd.conf file I have ServerName mercury You should set your ServerName to mercury.localdomain.com or the one exactly as shown from /etc/rc.conf under hostname="xxxxx.xxxx.xxx". |
|
#12
|
|||
|
|||
|
This is my hosts.sam file:
Quote:
When I type in mercury.domain.com in a browser, it still doesn't do anything. I have ServerName set to mercury.domain.com in my httpd.conf file and I restarted apache and did a killall -HUP httpd. Do I need to change anything else on my FreeBSD box? Do I need to save the hosts.sam file as just hosts? Thanks! |
|
#13
|
|||
|
|||
|
>> Do I need to save the hosts.sam file as just hosts?
Read this entire thread again. I only mentioned hosts.sam once and said it's for SAMPLE. I have been saying "Setup your C:\Windows\Hosts file, create it manually". >> Do I need to change anything else on my FreeBSD box? You need to make sure you have hostname="mercury.domain.com" in /etc/rc.conf, then reboot. Then verify your hostname: 1) Run this on FreeBSD: uname -a | awk ' {print $2}' 2) No. 1 above is equivalent to running uname -n 3) You can also run hostname Make sure your hostname is mercury.domain.com, not the alias hostname without the domain.com portion. >> I have ServerName set to mercury.domain.com in my httpd.conf file Make sure ServerName matches your hostname in /etc/rc.conf. >> I restarted apache and did a killall -HUP httpd Under no circumstance should you invoke httpd this way. You need to run apachectl graceful or apachectl restart. graceful will wait for all existing connections to be finished, then do a restart, while restart will kill all process immediately and force a non-graceful restart. >> When I type in mercury.domain.com in a browser, it still doesn't do anything Both /etc/hosts and C:\Windows\Hosts should be EXACTLY the same EXECPT the hostname of 127.0.0.1 may be different. /etc/hosts and C:\Windows\Hosts: 127.0.0.1 localhost.domain.com localhost 192.168.1.100 mercury.domain.com mercury 192.168.1.101 windows.domain.com windows Ping mercury.domain.com from FreeBSD, then ping it from Windows, to verify. You don't need to restart Windows and FreeBSD for just altering your hosts file. |
|
#14
|
|||
|
|||
|
Ok, thank you for all your help freebsd! I really appreciate it. It is now working. The last thing I'm wondering for right now, is, my router uses DHCP to give my machines dynamic ip addresses. Is there anyway to find the ip address of the machine? I don't leave my machines on at all times and it hasn't happened yet but sometime I might start the computer and have a different ip address. Would this be a setting in the routere to tell it not to give dynamic ips? Thanks!
|
|
#15
|
|||
|
|||
|
>> Is there anyway to find the ip address of the machine?
FreeBSD: (rl0 is your NIC) ifconfig rl0 | grep inet | awk '{print $2}' Windows: winipcfg /release 1 /batch C:\Windows\Temp\ip.txt type C:\Windows\Temp\ip.txt |find "IP Address" >> Would this be a setting in the routere to tell it not to give dynamic ips? Yes. There is a way to update your /etc/hosts on boot, but you can't update the IP of Windows, unless you do a search and find out if there is such a 3rd party utility for doing so. Here is a little script: #!/bin/sh nic=rl0 hostname=`hostname` hosts=/etc/hosts myip=`ifconfig $nic | grep inet | awk '{print $2}'` echo "Updating $hosts file..." echo "$myip $hostname" > $hosts |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > Which order to install ports? |