找回密码
 注册会员

QQ登录

只需一步,快速开始

微信登录

微信扫一扫,快速登录

查看: 4455|回复: 5

[网站源码] 短网址-YOURLS安装及配置教程与设置中文以及主题更换

[复制链接]

1

主题

0

回帖

3

积分

潜水

积分
3
发表于 2024-2-28 02:37:14 | 显示全部楼层 |阅读模式
前言

YOURLS是一款使用PHP+Mysql开发的短链接程序,相比公共短网址好处是数据掌握在自己手中,可控性更高!程序是来自GitHub的项目,开源且免费!如有需要缩短下载地址方便推广的小伙伴可以自行搭建使用,搭建方法相对比较简单~
本次教程还是基于宝塔搭建而成,快捷且效率
准备工作
  • vps服务器一台
  • 域名一个 并做好vps IP的解析
  • 宝塔面板以及安装php7.0以上+Mysql5.6
  • 源码一套,这里提供yourls主程序+主题+中文包打包下载
    游客,如果您要查看本帖隐藏内容请回复


教程开始

宝塔面板装完首次进入会提示安装配置环境,选择nginx+php+mysql即可
新建一个站点,输入提前解析好的短网址平台域名,php选择7.0以上,mysql数据库选中,点击添加
e040e1f8065a2946fc8c7891c73663b4.png
进入刚建立的站点根目录,将里面的4个文件全部选中删除,然后上传yourls主程序源码,加压缩后得到一个文件夹,进去将里面所有文件全部选中剪切到根目录,然后将zip包以及之前的空文件夹删除~
c268e2fc387871c54726caeb7dc58ad5.png
1,将解压的文件中的/user/config-sample.php文件名改成config.php
2,配置MySQL数据库
  1. #数据库用户名
  2. define( 'YOURLS_DB_USER', 'yourls' );

  3. #数据库密码
  4. define( 'YOURLS_DB_PASS', 'xxxxxxxx' );

  5. #数据库名
  6. define( 'YOURLS_DB_NAME', 'yourls' );

  7. #数据库连接地址
  8. define( 'YOURLS_DB_HOST', 'localhost' );

  9. #数据库表前缀,一般保持默认
  10. define( 'YOURLS_DB_PREFIX', 'yourls_' );
复制代码

3、设置用户名密码
  1. #修改配置文件
  2. vi user/config.php
  3. #设置用户名和密码,可设置多个用户
  4. $yourls_user_passwords = array(
  5.         'username' => 'password',
  6.         // 'username2' => 'password2',
  7.         // You can have one or more 'login'=>'password' lines
  8.         );
复制代码
4、其它设置
  1. #设置站点域名
  2. define( 'YOURLS_SITE', 'http://xiaofeng.us' );
  3. #GMT时间偏移
  4. define( 'YOURLS_HOURS_OFFSET', '-5' );
  5. #是否私有
  6. define( 'YOURLS_PRIVATE', 'true' );
  7. #设置cookie,可访问[url]https://api.yourls.org/services/cookiekey/1.0/[/url]生成
  8. define( 'YOURLS_COOKIEKEY', 'qQ4KhL_pu|s@Zm7n#%:b^{A[vhm' );
  9. #mysql连接方式
  10. define('YOURLS_DB_DRIVER','mysqli');
复制代码
5、设置伪静态
YOURLS默认已经内置Apache .htaccess规则,如果是Apache服务器且开启了伪静态支持一般不用在设置,如果您使用的Nginx,请添加下面的规则,并重载Nginx。
  1. location / {
  2.     try_files $uri $uri/ /yourls-loader.php?$args;
  3. }
复制代码
6、设置中文
YOURLS默认是中文界面,不方便操作,中文包已经再打包的压缩包里了,把解压到user/languages目录,然后修改user/config.php。
ab7d8bcd72d9a091289365722fd6e180.png
c4eefc178c426a43d39c203eba8d40c7.png
a9b4be04b2c282725024f1d030901c3a.png
7、访问测试
完成以上配置后访问http://你的域名/admin完成初安装,然后输入步骤3中设置的账号、密码就可以登录了。
db97def3edd9ec89f382a44398ecc54c.png
8、主题安装
将主题压缩包上传到网站根目录并解压,找到刚解压缩的infinity-squared-1.7.2文件夹,将里面内容全部剪切到根目录,再将zip压缩包以及infinity-squared-1.7.2这个空文件删除掉!
现在输入http://你的域名/看下效果
7897b02d4f3b39bd40e11107ff034049.png
主题设置
重命名public/config-sample.php为public/config.php
进入config.php进行页面文字修改,改成自己想要的~






0

主题

3

回帖

10

积分

潜水

积分
10
发表于 2024-5-23 14:56:44 | 显示全部楼层
看着不错
回复

使用道具 举报

0

主题

3185

回帖

6378

积分

传说

积分
6378
发表于 2025-7-24 16:31:33 | 显示全部楼层
回复

使用道具 举报

0

主题

3185

回帖

6378

积分

传说

积分
6378
发表于 2025-7-24 16:32:42 | 显示全部楼层
回复

使用道具 举报

0

主题

3185

回帖

6378

积分

传说

积分
6378
发表于 2025-8-2 14:08:21 | 显示全部楼层
http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ru
回复

使用道具 举报

0

主题

3185

回帖

6378

积分

传说

积分
6378
发表于 2025-8-2 14:09:26 | 显示全部楼层
http://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruhttp://magnetotelluricfield.ruhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ruhttp://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ru
http://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ruhttp://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ru
http://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ruhttp://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ru
http://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ruhttp://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ru
http://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员 微信登录

本版积分规则

小黑屋|简约版|网站地图|泡泡窝 ( 粤ICP备2023154091号-1|粤公网安备44098102660676号 )

GMT+8, 2025-8-26 01:38

Powered by Discuz! X3.5

Copyright © 2023-2024 Paopaowo.Com All Rights Reserved.

快速回复 返回顶部 返回列表