Friday, July 2, 2010

Zte ac2726 + smart + slackware 13.0

cara ini merupakan penyederhanaan dari cara sebelumnya http://4s3m.blogspot.com/2010/01/zte-ac2726-slackware-130.html

1. download and install latest "usb_modeswitch" package, and modem will be detected like this:



2. create file "/etc/ppp/peers/smart"

hide-password
noauth
asyncmap 0
modem
proxyarp
noipx
persist
idle 1000000
connect "/usr/sbin/chat -v -f /etc/ppp/peers/smartconnect"
debug
ttyUSB0
921600
defaultroute
noipdefault
user "smart"
remotename smart
ipparam smart
crtscts
lock
usepeerdns

3. create file "/etc/ppp/peers/smartconnect"

ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT DELAYED
'' "AT"
'OK' "ATQ0V1E0"
'OK' "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
OK-AT-OK "ATDT#777"
CONNECT \d\c

4. run pppd to connect

root@darkstar# pppd call smart

Free with OpenVPN

OpenVPN package has been installed.

1. generate the certificate authority

root@glowstar# cd /usr/share/doc/openvpn/examples/easy-rsa/2.0
root@glowstar# source ./vars
root@glowstar# ./clean-all
root@glowstar# ./build-ca

2. create the server and client keys

root@glowstar# ./build-key-server server
root@glowstar# ./build-key client

3. generate the diffie-hellman parameters

root@glowstar# ./build-dh

4. create /etc/openvpn/server.conf

local 74.x.x.x
port 443
proto udp
dev tun
ca /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/ca.crt
cert /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.crt
key /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.key 
dh /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
push "redirect-gateway"
push "dhcp-option DNS 208.68.222.222"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3

5. start OpenVPN server

root@glowstar# openvpn /etc/openvpn/server.conf

6. copy this file to the client computer:

/usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/ca.crt
/usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/client.crt
/usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/client.key 

7. create client.conf

client
dev tun
proto udp
remote 74.x.x.x 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
comp-lzo
verb 3

8. load module "tun" and connect to server

root@darkstar# /sbin/modprobe tun
root@darkstar# openvpn client.conf

9. if connected it will be like this:



10. try ping the server



11. now, may you can create ssh connection? ;)

Thursday, July 1, 2010

Printing service S13

1. set executable rc.cups
root@dakrstar# chmod +x /etc/rc.d/rc.cups

2. run print server
root@dakrstar# /etc/rc.d/rc.cups start

3. open administration page
# http://localhost:631/

Setting mysqld S13

1. create db
root@darkstar# mysql_install_db --user=mysql

2. set executable rc.mysqld
root@dakrstar# chmod +x /etc/rc.d/rc.mysqld

3. run mysql server
root@darkstar# /etc/rc.d/rc.mysqld start

4. run secure instalation
root@darkstar# mysql_secure_installation

Setting httpd S13

1. edit /etc/httpd/httpd.conf
###############################
# simple httpd.conf
###############################
ServerRoot "/usr"
Listen 80
LoadModule authn_file_module lib/httpd/modules/mod_authn_file.so
LoadModule authn_dbm_module lib/httpd/modules/mod_authn_dbm.so
LoadModule authn_anon_module lib/httpd/modules/mod_authn_anon.so
LoadModule authn_dbd_module lib/httpd/modules/mod_authn_dbd.so
LoadModule authn_default_module lib/httpd/modules/mod_authn_default.so
LoadModule authn_alias_module lib/httpd/modules/mod_authn_alias.so
LoadModule authz_host_module lib/httpd/modules/mod_authz_host.so
LoadModule authz_groupfile_module lib/httpd/modules/mod_authz_groupfile.so
LoadModule authz_user_module lib/httpd/modules/mod_authz_user.so
LoadModule authz_dbm_module lib/httpd/modules/mod_authz_dbm.so
LoadModule authz_owner_module lib/httpd/modules/mod_authz_owner.so
LoadModule authnz_ldap_module lib/httpd/modules/mod_authnz_ldap.so
LoadModule authz_default_module lib/httpd/modules/mod_authz_default.so
LoadModule auth_basic_module lib/httpd/modules/mod_auth_basic.so
LoadModule auth_digest_module lib/httpd/modules/mod_auth_digest.so
LoadModule file_cache_module lib/httpd/modules/mod_file_cache.so
LoadModule cache_module lib/httpd/modules/mod_cache.so
LoadModule disk_cache_module lib/httpd/modules/mod_disk_cache.so
LoadModule mem_cache_module lib/httpd/modules/mod_mem_cache.so
LoadModule dbd_module lib/httpd/modules/mod_dbd.so
LoadModule dumpio_module lib/httpd/modules/mod_dumpio.so
LoadModule reqtimeout_module lib/httpd/modules/mod_reqtimeout.so
LoadModule ext_filter_module lib/httpd/modules/mod_ext_filter.so
LoadModule include_module lib/httpd/modules/mod_include.so
LoadModule filter_module lib/httpd/modules/mod_filter.so
LoadModule substitute_module lib/httpd/modules/mod_substitute.so
LoadModule deflate_module lib/httpd/modules/mod_deflate.so
LoadModule ldap_module lib/httpd/modules/mod_ldap.so
LoadModule log_config_module lib/httpd/modules/mod_log_config.so
LoadModule log_forensic_module lib/httpd/modules/mod_log_forensic.so
LoadModule logio_module lib/httpd/modules/mod_logio.so
LoadModule env_module lib/httpd/modules/mod_env.so
LoadModule mime_magic_module lib/httpd/modules/mod_mime_magic.so
LoadModule cern_meta_module lib/httpd/modules/mod_cern_meta.so
LoadModule expires_module lib/httpd/modules/mod_expires.so
LoadModule headers_module lib/httpd/modules/mod_headers.so
LoadModule ident_module lib/httpd/modules/mod_ident.so
LoadModule usertrack_module lib/httpd/modules/mod_usertrack.so
LoadModule unique_id_module lib/httpd/modules/mod_unique_id.so
LoadModule setenvif_module lib/httpd/modules/mod_setenvif.so
LoadModule version_module lib/httpd/modules/mod_version.so
LoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_connect_module lib/httpd/modules/mod_proxy_connect.so
LoadModule proxy_ftp_module lib/httpd/modules/mod_proxy_ftp.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule proxy_scgi_module lib/httpd/modules/mod_proxy_scgi.so
LoadModule proxy_ajp_module lib/httpd/modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module lib/httpd/modules/mod_proxy_balancer.so
#LoadModule ssl_module lib/httpd/modules/mod_ssl.so
LoadModule mime_module lib/httpd/modules/mod_mime.so
LoadModule dav_module lib/httpd/modules/mod_dav.so
LoadModule status_module lib/httpd/modules/mod_status.so
LoadModule autoindex_module lib/httpd/modules/mod_autoindex.so
LoadModule asis_module lib/httpd/modules/mod_asis.so
LoadModule info_module lib/httpd/modules/mod_info.so
LoadModule cgi_module lib/httpd/modules/mod_cgi.so
LoadModule dav_fs_module lib/httpd/modules/mod_dav_fs.so
LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so
LoadModule negotiation_module lib/httpd/modules/mod_negotiation.so
LoadModule dir_module lib/httpd/modules/mod_dir.so
LoadModule imagemap_module lib/httpd/modules/mod_imagemap.so
LoadModule actions_module lib/httpd/modules/mod_actions.so
LoadModule userdir_module lib/httpd/modules/mod_userdir.so
LoadModule alias_module lib/httpd/modules/mod_alias.so
LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User nobody 
Group nogroup

</IfModule>
</IfModule>
ServerAdmin you@example.com
ServerName localhost
DocumentRoot "/home/zam/web/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/home/zam/web/htdocs">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>

<IfModule dir_module>
DirectoryIndex index.html index.html.var index.php index.php3 index.php4
</IfModule>
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

ErrorLog "/var/log/httpd/error_log"
LogLevel warn

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "/var/log/httpd/access_log" common
</IfModule>

<IfModule alias_module>
ScriptAlias /cgi-bin/ "/srv/httpd/cgi-bin/"
</IfModule>

<IfModule cgid_module>
</IfModule>
<Directory "/srv/httpd/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
DefaultType text/plain

<IfModule mime_module>
TypesConfig /etc/httpd/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddHandler cgi-script .cgi .pl
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
Include /etc/httpd/extra/httpd-multilang-errordoc.conf
Include /etc/httpd/extra/httpd-autoindex.conf
Include /etc/httpd/extra/httpd-default.conf
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Include /etc/httpd/mod_php.conf
###############################

2. set executable file rc.httpd
root@darkstar# chmod +x /etc/rc.d/rc.httpd

3. run httpd server
root@darkstar# /etc/rc.d/rc.httpd start

Setting samba S13

Berikut ini merupakan cara yang saya lakukan untuk melakukan file sharing pada linux slackware saya :

1. create file /etc/samba/smb.conf
##################
# smb.conf Created by zam
##################
[global]
workgroup = H3LL0L4M3RZ
server string = Hack Me
security = user

[zam]
comment = sambaku
path = /home/zam/smb
public = yes 
writable = yes
user = zam
##################

2. create directory /home/zam/smb
zam@darkstar# mkdir /home/zam/smb

3. set executable rc.samba
root@darkstar# chmod +x /etc/rc.d/rc.samba

4. create password for samba user
root@darkstar# smbpasswd -a zam

5. run samba server
root@darkstar# /etc/rc.d/rc.samba start