Showing posts with label www. Show all posts
Showing posts with label www. Show all posts

Apache22 Port di FreeBSD 8.2 Stable

| Thursday, December 15, 2011

Kemarin setelah update ke FreeBSD stable 8.2 dan CVsup it coz me trouble.
In da middle on installation i got

/usr/ports/www/apache22/work/httpd-2.2.16/support/htpasswd.c:133: undefined reference to `apr_generate_random_bytes'
*** Error code 1
1 error

it made me frustated, after a day search and following instruction from freebsd forum i got nothing. so i assume that maybe something wrong with the port and i have to fix it.

Here is the solution i've found from the inet to fix a broken port.
It works for me .. :)

# Change into the ports directory
cd /usr/ports/
# First fetch ports index
make fetchindex
# Build the ports database
portsdb -u
# Show out of date ports
pkg_version -l "<"
# Upgrade ports
portupgrade -arR
# Check for stale dependencies
pkgdb -F
# Clean out work directories and delete old distfiles
portsclean -CDD _________________

install eaccelerator di freebsd

| Friday, July 16, 2010

cd /usr/ports/www/eaccelerator

You have installed the eaccelerator package.
Edit /usr/local/etc/php.ini and add:
zend_extension="/usr/local/lib/php/20060613/eaccelerator.so"
Then create the cache directory:
mkdir /tmp/eaccelerator
chown www /tmp/eaccelerator
chmod 0700 /tmp/eaccelerator

u can try to config :
zend_extension="/usr/local/lib/php/20060613/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

eaccelerator.shm_size
This setting will allow you to control the amount of shared memory eAccelerator should allocate to cache PHP scripts. The number sets the amount of memory in megabytes. Setting this value to 0 will use the default size.

eaccelerator.shm_size

This setting will allow you to control the amount of shared memory eAccelerator should allocate to cache PHP scripts. The number sets the amount of memory in megabytes. Setting this value to 0 will use the default size.

eaccelerator.shm_size = "0"

On Linux the maximum amount of memory a process can allocate is limited by the number set in /proc/sys/kernel/shmmax. Allocating more than this value will result in eAccelerator failing to initialise. The size in this file is given in bytes. You can raise this amount with:

echo value > /proc/sys/kernel/shmmax

Where value is the size in bytes you want to use. This value is reset to the default value evertime you reboot, but you can raise it permanently by adding the amount you need in /etc/sysctl.conf. This is done by adding:

kernel.shmmax = value

eaccelerator.cache_dir

This directory is used for the disk cache. eAccelerator stores precompiled code, session data, content and user entries here. The same data can be stored in shared memory (for quicker access). The default value is “/tmp/eaccelerator”.

eaccelerator.cache_dir = "/tmp/eaccelerator"

This is easy because that directory is easily writable to everyone, and mounted with noexec. However, it isn’t the best because on a lot of systems this directory is cleared on reboot. A better place is /var/cache/eaccelerator. Create the directory and make sure it’s writable to the process eAccelerator runs under.

A safe bet is making it world writeable, a safer and cleaner way is making the user php runs under (most of the time the same user as apache or lighttpd) the owner and set 0644 permissions.

The lazy way:

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator

eaccelerator.enable

With this setting you can enable or disable eAccelerator. This may seem like a pretty stupid setting, but it can be very useful. For example this setting can also be used in the vhost section of the Apache configuration. It allows you to disable eAccelerator for a certian vhost by placing php_admin_value eaccelerator.enable 0 in the vhost section.

Setting this value to “1″ enables eAccelerator, which is also the default value. Setting it to “0″ will disable eAccelerator.

eaccelerator.enable = "1"

eaccelerator.optimizer

Enables or disables the optimizer which may speed up code execution. Setting it “1″ will enable eAccelerator, “0″ disables it. By default the optimizer is enabled. The optimizer will only run when the script is compiled before it’s cached.

eaccelerator.optimizer = "1"

eaccelerator.debug

Enables or disables debug logging. Setting this to 1 will print information to the log file about the cache hits of a file. This is only useful when debugging eAccelerator for bug reports.

eaccelerator.debug = 0

eaccelerator.log_file

Set the log file for eaccelerator. When this option isn’t set then the data will be logged to stderr, when using PHP with Apache these lines will be added to the Apache error log.

eaccelerator.log_file = "/var/log/httpd/eaccelerator_log"

eaccelerator.name_space

When using the user cache api for storing data in shared memory, all keys are prepended by the hostname used for the current request. This hostname equals the ServerName? set in the vhost section of apache. This is done to avoid duplicate keys between vhosts. Sometimes this behaviour is desired to share data between vhosts. When setting this option this namespace is used to prepend to each key. By default this is set to “” which instructs eAccelerator to use the hostname as namespace.

When setting this in the main PHP configuration file this namespace will be used by all vhosts. This value can also be set in the vhost section or even in a .htaccess file to allow sharing of data between only two vhosts.

eaccelerator.name_space = ""

eaccelerator.check_mtime

On every hit eAccelerator will check the modification time of a script to see if it changed and needs to be recompiled. Although this is a lot faster then opening the file and compiling it, this still adds some overhead because a stat call needs to be done every time. This setting allows you to disable this check. The downside of disabling this check is that you need to manually clean the eAccelerator cache when you update a file.

By default this check is enabled.

eaccelerator.check_mtime = "1"

eaccelerator.filter

Determine which PHP files can be cached. You can specify the pattern (for example “*.php *.phtml”) the PHP script filename needs to match. If a pattern starts with “!”, the files that match that pattern are excluded from the cache. Default value is “” which will cache all scripts PHP compiles.

Please note that eaccelerator.filter doesn’t work on a URL basis but rather on the absolute filesystem path, so a filter of !/home* would exclude all scripts in /home from being cached.

Multiple patterns need to be seperated by spaces or tabs, but not commas.

eaccelerator.filter = ""

eaccelerator.shm_max

By default there is no limit on the maximum size a user can put in shared memory with functions like eaccelerator_put, the maximum size is controlled by this setting. This value is the maximum size that can be put in the cache, the size is given in bytes (10240, 10K, 1M). The default value is “0″ which disables the limit.

This setting doesn’t affect the maximum size for a script”’

eaccelerator.shm_max = "0"

eaccelerator.shm_ttl

When eAccelerator doesn’t have enough free shared memory to cache a new script it will remove all scripts from shared memory cache that haven’t been accessed in at least shm_ttl seconds. By default this value is set to “0″ which means that eAccelerator won’t try to remove any old scripts from shared memory.

eaccelerator.shm_ttl = "0"

eaccelerator.shm_prune_period

When eAccelerator doesn’t have enough free shared memory to cache a script it tries to remove old scripts if the previous try was made more then “shm_prune_period” seconds ago. Default value is “0″ which means that eAccelerator won’t try to remove any old script from shared memory.

eaccelerator.shm_prune_period = "0"

eaccelerator.shm_only

Enable or disable caching of compiled scripts on disk. This has no effect on session data and content caching. Default value is “0″ which allows eAccelerator to use disk and shared memory cacche for scripts.

eaccelerator.shm_only = "0"

eaccelerator.compress

When using the eaccelerator_content_* api eAccelerator can compress the content before saving it to memory. By default this is set to “1″, to disable compression set it to “0″.

eaccelerator.compress = "1"

eaccelerator.compress_level

Compression level used for content caching. Default value is “9″ which is the maximum compression level.

eaccelerator.compress_level = "9"

eaccelerator.keys | session | content

These settings control the places eAccelerator may cache user content. Possible values are:

  • shm_and_disk cache data in shared memory and on disk (default value)
  • shm cache data in shared memory or on disk if shared memory is full or data size greater then “eaccelerator.shm_max”
  • shm_only cache data in shared memory
  • disk_only cache data on disk
  • none don’t cache data
eaccelerator.keys     = "shm_and_disk"
eaccelerator.sessions = "shm_and_disk"
eaccelerator.content = "shm_and_disk"

The webinterface

eAccelerator can be managed through a webinterface. From version 0.9.5 this webinterface has been fully implemented in php so the settings have been changed.


taken from : http://techgurulive.com/2009/02/02/how-to-install-and-configure-the-eaccelerator-php-cache-on-apache/

Belum sempat nerjemahin.. ntar aja soale lagi seru coba2


Generate pdf problem

| Wednesday, July 14, 2010

Pernah mengalami generate file dari script php ke pdf dan tidak berhasil?
padahal jika dilocalhost yg memakai xamp berjalan normal.

Setelah saya cek lebih lanjut ternyata jika record yg digenerate tidak begitu banyak, dibawah 100 record berhasil.
Nah lo, mulai berpikir.. apa mgkn konfigurasi buffer file atau cache file di php.ini nya atau webserver confignya.

Setelah mencoba mengulik2, alhamdulillah ketemu.Ini dia, dengan memory limit 96MB, maka generate 2ribu record berhasil dieksekusi. Tinggal disesuaikan dgn kebutuhan saja.

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 96M

Captive portal dgn apache-ssl & chillispot

| Thursday, March 06, 2008

Postingan ini repost, berhubung yang dulu belum selesai dan kebetulan ada teman yang lagi pusing² mau nyoba captive portal ini. Kita mulai aja ya,.. *baca bismillah*

SESI KONFIGURASI HARDWARE

# ee /usr/src/sys/i386/conf/kernelku

Edit file kernelku, untuk firewall terserah tapi untuk device tun wajib, fadhu ain!

options IPFIREWALL
options IPFIREWALL_VERBOSE
options IPFIREWALL_DEFAULT_TO_ACCEPT
options IPFIREWALL_FORWARD
options IPFILTER
options IPDIVERT (jika natnya nanti menggunakan NATD)
options DUMMYNET
options TCP_DROP_SYNFIN
device tun

simpan dan building kernel
# config kernelku
Kernel build directory is ../compile/kernelku
Don't forget to do a ``make depend''
# cd ../compile/kernelku
# make depend && make && make install && reboot

Ok, urusan kernel selesai, pastikan kita memiliki 2 NIC. Untuk NIC yang terhubung ke internet silahkan diconfig, sedangkan untuk yang terhubung ke AP(Wireless device) jangan diberi ip. Berikut contohnya :

# ifconfig
rl0: flags=8802 mtu 1500 options=8 ether 00:0e:2e:cb:3c:bb media: Ethernet autoselect
media: Ethernet autoselect (100baseTX ) status: active

xl0: flags=8843 mtu 1500 options=9 inet 203.134.232.20 netmask 0xffffffc0 broadcast 203.134.232.63 inet6 fe80::2b0:d0ff:fe4b:af9%xl0 prefixlen 64 scopeid 0x2 ether 00:b0:d0:4b:0a:f9 media: Ethernet autoselect (100baseTX ) status: active

Untuk AP (Access Point) setting saja ssidnya, Modenya mode Access Point dan IPnya terserah (ip defaultnya ga masalah) yang penting client bisa konek ke AP kita. jangan aktifkan dhcpnya karena nanti chilli yang akan memberi ip ke client yang konek.

SESI MUMETISASI

Ok Urusan hardwarenya selesai, sekarang mulai proses instalasi software2 yang dibutuhkan :

download source file openssl openssl-0.9.8e dan ekstrak
./config
make && make test && make install

download source file apache httpd-2.2.3 dan ekstrak
./configure --prefix=/usr/local/apache --enable-ssl --with-ssl=/usr/local/ssl
make && make install

Untuk mengaktifkan ssl di httpd bisa di link ini http://www.dev411.com/wiki/Installing_Apache2_SSL

Untuk instalasi radius, ikuti petunjuk di postingan saya yang ini (mysql harus terinstall ya)

download source file chillispot-1.0 dan ekstrak
./configure
make && make install

# ee /usr/local/apache/conf/httpd.conf (setting directory cgi & ssl saya sbb:)
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
Include conf/extra/httpd-ssl.conf

# ee /usr/local/apache/conf/extra/httpd-ssl.conf
Listen 443
DocumentRoot "/data"
ServerName 192.168.182.1
ServerAdmin noc.spin.net.id
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key

# cp /usr/local/share/chillispot/hotspotlogin.cgi /usr/local/www/cgi-bin/
# cp /usr/local/share/chillispot/chilli.conf /etc/chilli.conf

Saya anggap instalasi freeradius dan mysqlnya sudah terinstall dan berhasil.
Untuk chilli, konfigurasinya ada di /etc/chilli.conf, setting sbb :
net 192.168.182.0/24
dynip 192.168.182.0/24
statip 192.168.182.0/24
dns1 203.134.239.153
dns2 203.134.232.3
radiuslisten 203.134.232.20
radiusserver1 203.134.232.35 (ip dimana radius server terinstall)
radiusserver2 203.134.232.35 (ip dimana radius server terinstall)
radiusauthport 1812
radiusacctport 1813

# TAG: radiussecret
# Radius shared secret for both servers
# For all installations you should modify this tag.
radiussecret testing123
# password radius ada di /usr/local/etc/raddb/clients.conf

dhcpif rl0
# nama interface yang terhubung ke wireless device

# Universal access method (UAM) parameters
uamserver https://192.168.182.1/cgi-bin/hotspotlogin.cgi
uamhomepage http://192.168.182.1/welcome.html
uamsecret ht2eb8ej6s4et3rg1ulp
uamport 3990
uamallowed 192.168.182.1,203.134.232.20,203.134.232.35,203.134.232.3,203.134.239.153

# ee /usr/local/apache/cgi-bin/hotspotlogin.cgi
$uamsecret = "ht2eb8ej6s4et3rg1ulp";
$userpassword=1;

Uam secret pada chilli.conf dan hotspotlogin.cgi harus sama.
Untuk directory web saya terletak di /data dan saya create welcome.html disana dengan isi sbb :

Click Here For Login

Aktifkan ipnat di /etc/defaults/rc.conf kemudian tambahkan baris berikut di file konfigurasi ipnatnya.
# ee /etc/ipnat.rules
map rl0 192.168.182.0/24 -> 203.134.232.20/32

OK, jika sudah selesai semua, jalankan chillinya sbb :
# chilli --fg -c /etc/chilli.conf &
Hasil ifconfig sbb :

rl0: flags=8843 mtu 1500
options=8
inet 0.0.0.0 netmask 0xff000000 broadcast 0.255.255.255
inet6 fe80::20e:2eff:fecb:3cbb%rl0 prefixlen 64 scopeid 0x1
ether 00:0e:2e:cb:3c:bb
media: Ethernet autoselect (100baseTX )
status: active

xl0: flags=8843 mtu 1500
options=9
inet 203.134.232.20 netmask 0xffffffc0 broadcast 203.134.232.63
inet6 fe80::2b0:d0ff:fe4b:af9%xl0 prefixlen 64 scopeid 0x2
ether 00:b0:d0:4b:0a:f9
media: Ethernet autoselect (100baseTX )
status: active

tun0: flags=8051 mtu 1500
inet6 fe80::20e:2eff:fecb:3cbb%tun0 prefixlen 64 scopeid 0x4
inet 192.168.182.1 --> 192.168.182.1 netmask 0xffffff00
Opened by PID 42197

Selamat mencoba dan jangan menyerah ya.. saya juga butuh berhari-hari koq nguplek² ini dan alhamdulillah berhasil.. tapi akhirnya ngga dipakai... asem! :P

Instalasi Mysql Server

| Tuesday, February 20, 2007

MySQL install :

Download binary mysql-5.0.21.tar.gz
# tar xvf mysql-5.0.21.tar.gz
# cd mysql-5.0.21
# ./configure --prefix=/opt/mysql --with-mysqld-user=mysql
# make all && make install

# Install the base database
/opt/mysql/bin/mysql_install_db
# Add a “mysql” user to your system: (MySQL should not need to run as root!)
pw groupadd mysql
pw useradd mysql -g mysql


# Set permissions to correct owner
chown -R mysql:mysql /opt/mysql/

# Start the server
/opt/mysql/bin/mysqld_safe &

# Perform Basic Checks
/opt/mysql/bin/mysqladmin version
/opt/mysql/bin/mysqladmin variables

# Set a Password!
/opt/mysql/bin/mysqladmin -u root password wekQ

# Add a "database" user with password and grant that user permission to connect
/opt/mysql/bin/mysql --user=root --password mysql
wekQ

GRANT ALL PRIVILEGES ON *.* TO mysql@localhost IDENTIFIED BY 'wekQ' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO mysql@"%" IDENTIFIED BY 'wekQ' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit

# Run some tests before going into production (optional)
/opt/mysql/mysql-test/mysql-test-run --force


Copy and test the "rc" boot time startup script
# Copy the "rc" startup script
cp /usr/src/mysql-5.0.21/support-files/mysql.server /usr/local/etc/rc.d/mysql.sh
chmod 755 /usr/local/etc/rc.d/mysql.sh

# Test the "rc" script
/usr/local/etc/rc.d/mysql.sh restart
/usr/local/etc/rc.d/mysql.sh stop
/usr/local/etc/rc.d/mysql.sh start
/usr/local/etc/rc.d/mysql.sh reload