Detect RB44GV on FreeBSD 7

New ethernet card we order arrived yesterday, its RB44GV from mikrotik. I just curious to see if its work with my FreeBSD box 🙂

materibasuki# ifconfig -a
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
ether 00:1a:92:b3:db:c2
inet 172.88.1.7 netmask 0xfffff000 broadcast 172.88.15.255
media: Ethernet autoselect (1000baseTX <full-duplex>)
status: active
em1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
ether 00:1a:92:b3:db:c3
media: Ethernet autoselect
status: no carrier
vge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
ether 00:0c:42:1a:26:48
media: Ethernet autoselect (none)
status: no carrier
vge1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
ether 00:0c:42:1a:26:49
media: Ethernet autoselect (none)
status: no carrier
vge2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
ether 00:0c:42:1a:26:4a
media: Ethernet autoselect (none)
status: no carrier
vge3: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
ether 00:0c:42:1a:26:4b
media: Ethernet autoselect (none)
status: no carrier
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
inet6 fe80::1%lo0 prefixlen 64 scopeid 0×8
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000

Another question from my friend. Is it real gigabit card?

Hmmm, I dunno but after few moment :

edp# cd /sys/i386/conf/
edp# ls
.cvsignore GENERIC MAC NOTES XBOX
DEFAULTS GENERIC.hints Makefile PAE

edp# cat GENERIC | grep vge
device vge # VIA VT612x gigabit Ethernet
edp#

Yes, its gigabit ethernet card 😉

Make Virtual Host in Engine X (nginx)

Since last time I install php-fpm in my freebsd box I still looking way to make virtualhost. I think its not easy to make vhost in nginx but I’m wrong 🙂

Just add :

server {

directive

}

will add new vhost.

Full sample from my vhost :

server {
        listen          80;
        server_name     sandbox.digitalfusi.com;

        location / {
            index index.php index.html;
            root  /usr/local/www/nginx/sandbox;
        }
            location ~ \.php$ {
           fastcgi_pass    127.0.0.1:9000;
           fastcgi_index   index.php;
          fastcgi_param     SCRIPT_FILENAME
  /usr/local/www/nginx/sandbox$fastcgi_script_name;
           include      fastcgi_params;
           }

    }

another feature that I learn too is ‘autoindex’ since my friend need to list all files and directory if no index files exists.

For more fancy index I need to recompile it with fancyindex but I’m OK with it 🙂

Full sample of nginx.conf for two vhost with autouindex on and off can be download from here.

in Unix | 144 Words

101 nginx tutorial and articles

I’m bit lazy to read manual and prefer to read it as a case. Nginx is my favourite now, by collecting related tutorial, blog posting and articles I hope I can learn nginx more.

Links I found so far :

  1. Reverse proxy in depth tutorial
  2. Step by step install Engine X (nginx) and php-fpm in FreeBSD
  3. Dreamier Dream Server with Nginx
  4. Setting Up nginx
  5. New Nginx.conf with optimizations
  6. NginxVirtualHostExample
  7. Nginx as a reverse proxy for Apache
  8. WordPress with Apache and NginX
  9. Moving to Nginx
  10. Nginx + PHP + PHP-FPM on Debian Etch 4.0
  11. WordPress + NGINX : plain permalinks without rewrite
  12. HOWTO: Install WordPress on Nginx
  13. NginX Reporting for Duty
  14. How to do your Nginx rewrites on a Multi User WordPress Integrated with BBPress
  15. Rewrite Non-SSL traffic to SSL Virtual Host with Nginx
  16. HOWTO: Configure nginx for Debian / Ubuntu
  17. Nginx Hacking Tips
  18. Tips on Configuring Nginx for Virtual Hosting
  19. Nginx and Memcached, a 400% boost!
  20. Install Nginx On Ubuntu Server 9.04

More links will be add.

Last Update : May 14 2009

Step by step install Engine X (nginx) and php-fpm in FreeBSD

Nginx already in my list for almost 3 month but I don’t have time for play around with it. As usual freebsd ports is my preferable method to install software in FreeBSD 🙂

I’m lucky to get php-fpm ports from php-fpm site that work for php-5.2.3RC. After change it a bit for php 5.2.6 I can test it together with nginx stable from ports too.

Here’s my steps for install nginx with php-fpm using FreeBSD ports :

1. Install nginx

alamster# cd /usr/ports/www/nginx
alamster# make install

I choose :

HTTP_MODULE
HTTP_REWRITE_MODULE
HTTP_SSL_MODULE
HTTP_STATUS_MODULE

2. Install php

alamster# cd /usr/ports/lang/php5
alamster# make install

I choose :

CLI
CGI
SUHOSIN
IPV6
FASTCGI
PATHINFO

Continue reading

undefined function imagecreatefromjpeg()

Call to undefined function imagecreatefromjpeg() in /home/materi/prog/cms_study/admin/pageuploadadd.php on line 88
 
Yes, that message show up when my friend try to access web based application.

I think thats my fault 🙂

Doing preliminary check :

edp# pkg_info | grep php5-gd
edit /etc/make.conf

PERL_VER=5.8.8
PERL_VERSION=5.8.8
WITHOUT_X11=yes

save.

edp# whereis php5-gd
php5-gd: /usr/ports/graphics/php5-gd
edp# cd /usr/ports/graphics/php5-gd && make install

edp# apachectl restart
done.

That message disappear 🙂